barrel-defgen
v1.1.0
Published
Generates type definitions into a single file from a barrel file
Downloads
6
Maintainers
Readme
barrel-defgen
Simple CLI library based on dts-generator to create TypeScript definition files out of barrel files.
In order to work with this CLI, your tsconfig.json
file must define a files
entry, pointing to the barrel file.
Usage
Usage:
barrel-defgen [options]
Description:
Generates type definitions into a single file from a barrel file.
Options:
--name Id of the namespace to declare. Defaults to pascal cased
directory name [string]
--out Output file for definitions. Defaults to index.d.ts [string]
--project Directory of TypeScript project where tsconfig.json exists
[string]
--help, -h Show help [boolean]
--version, -v Show version number [boolean]
API
If you prefer to work with the node API, import app/lib.
const barrelDefgen = require('barrel-defgen/app/lib');
barrelDefGen({
name: 'some-namespace',
out: 'output.d.ts',
project: 'path/to/ts-project'
});
See documentation for further information.