Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Sturlen/open5e-typesafe-api

Repository files navigation

Moved to https://github.com/Sturlen/open5e-ts/

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/open5e
pnpm install @sturlen/open5e

Usage

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)

References

Open5e Site Open5e API

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published