i18next-utilities-ts-cli
v1.0.4
Published
Generate i18next type definitions from your resource files.
Downloads
11
Readme
i18next-utilities-ts-cli
A CLI tool to generate TypeScript types for i18next based on your resource files. Point it to your default locale and it will generate types from .json
, .yaml
, or .yml
files.
Usage
npx i18next-utilities-ts-cli gen -i ./path/to/locales/en-GB -o ./i18next.d.ts
Options
| Option | Type | Default | Description |
| ------------------------------ | ------------------------------ | -------------------------------------- | --------------------------------------------- |
| -i
, --input
| string
| | The input directory for the default locale. |
| -o
, --output
| string
| | The output file for the generated types. |
| -l
, --default-locale
| string
| | The default locale for the resource files. |
| -g
, --glob
| string[]
| ["**/*.json","**/*.yml","**/*.yaml"]
| The glob pattern to match the resource files. |
| -n
, --namespace-resolution
| "basename"
, "relativePath"
| "basename"
| The resolution strategy for the namespace. |
| -d
, --default-namespace
| string
| "translation"
| The default namespace for the resource files. |