npp2ts
v1.0.0
Published
Typescript definitions generator for [node-pogo-protos](https://github.com/cyraxx/node-pogo-protos)
Downloads
2
Readme
npp2ts
Typescript definitions generator for node-pogo-protos
Install
npm install npp2ts
or
npm install npp2ts --global
for access from anywhere in your system
Usage:
npp2ts -f protos.json -o protos.d.t.s
or
npp2ts -f protos.json
Where:
-f
- Input file model generated by pbjs
-o
- Output file with definitions. If not provided the buffer will be flushed
You can also import a module inside your javascript:
// node env
const npp2ts = require('npp2ts');
// typescript env
import {npp2ts} from 'npp2ts';
// and just use it as a function that requires one parameter (-f)
const dts = npp2ts('protos.json');
// now `dts` includes all the definitions
// or with two parameters (-f and -o)
npp2ts('protos.json', 'protos.d.ts');