Collections & Knowledge

Lost Books

Access the complete dataset of Lost Books found in Stardew Valley with typed name, description, and image information using the LostBookQuery API.

Quick Start

import { lostBooks } from 'stardew-valley-data'

// Get all lost books
const all = lostBooks().get()

// Find a specific book by name
const book = lostBooks().findByName('Tips on Farming')

// Count total lost books
const total = lostBooks().count()

// Get the first book
const first = lostBooks().first()

Type Definition

Each lost book record conforms to the LostBook interface:

FieldTypeDescription
idstringUnique identifier for the book.
namestringTitle of the lost book.
descriptionstringThe text content of the book.
imagestringPath to the book image.

Query Methods

LostBookQuery extends QueryBase and inherits five terminal methods shared by all query builders:

MethodReturnsDescription
get()LostBook[]Return all results as an array.
first()LostBook | undefinedReturn the first result.
find(id)LostBook | undefinedFind a book by exact ID.
findByName(name)LostBook | undefinedFind a book by name (case-insensitive).
count()numberReturn the number of results.

Examples

List all lost books

import { lostBooks } from 'stardew-valley-data'

const all = lostBooks().get()

all.forEach((book) => {
  console.log(`${book.name}`)
})

Read a specific book

import { lostBooks } from 'stardew-valley-data'

const book = lostBooks().findByName('Tips on Farming')

if (book) {
  console.log(`Title: ${book.name}`)
  console.log(`Content: ${book.description}`)
}

Find a book by ID

import { lostBooks } from 'stardew-valley-data'

const book = lostBooks().find('lost-book-1')

if (book) {
  console.log(`${book.name}: ${book.description}`)
}

Wrap a pre-filtered array

You can pass an existing LostBook[] array into the lostBooks() function to create a new query from it:

import { lostBooks } from 'stardew-valley-data'

const myList = lostBooks().get()
const reWrapped = lostBooks(myList).count()
Previous
Collections