1.0.0-5 • Published 2 years ago
@sturlen/open5e v1.0.0-5
Makes working with Open5e data in Typescript a breeze. All data is validated using Zod schemas, which gives you great autocomplete and runtime safety.
Install
npm install @sturlen/open5epnpm install @sturlen/open5eUsage
import { Open5e } from "@sturlen/open5e"
// Query
const dragons = await Open5e.monsters.findMany({
limit: 50,
document__slug: "tob",
search: "dragon",
})
// Use
dragons.forEach((monster) => console.log(monster.name))
// You can access the schemas and use them separately
Ope5e.monsters.schema.parse(YourObject)