@kraftend/directus-typegen
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@kraftend/directus-typegen

This is a Directus helper that generates types for your instance.

How to install

pnpm install @kraftend/directus-typegen

How to use

pnpm run directus-typegen --url https://directus.example.com --token <token> --output ./directus-schema.ts

All of the options are optional. Url and token can also be set via environment variables:

DIRECTUS_API_URL="https://directus.example.com"
DIRETUS_API_TOKEN="super-secret-token"

Thanks

Initial code was taken from maltejur/directus-extension-generate-types.

However adding extension to the directus itself and copying types every time you update directus is not very convenient. So I decided to make it a separate package to run from cli in the projects where Directus api is used.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.06latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.06

Package Sidebar

Install

npm i @kraftend/directus-typegen

Weekly Downloads

6

Version

1.0.0

License

MIT

Unpacked Size

74.3 kB

Total Files

15

Last publish

Collaborators

  • cemreinanc