microsoft / dts-gen

dts-gen creates starter TypeScript definition files for any module or library.
MIT License
2.44k stars 102 forks source link

Support "templates" for creating easy stubs #10

Open RyanCavanaugh opened 8 years ago

RyanCavanaugh commented 8 years ago

When a library can't load, we should still be able to generate something so that we can use this tool in lieu of explaining everything about how to set up a correct DefinitelyTyped folder

corymayer commented 7 years ago

The command on the DefinitelyTyped readme seems to imply this is possible but it no longer works: dts-gen --dt --name my-package-name --template

According the to the usage message it seems the correct command is now dts-gen --template module --name my-package-name --dt, but it produces this error on macOS 10.12:

Error: ENOENT: no such file or directory, mkdir 'types/homebridge' at Object.fs.mkdirSync (fs.js:895:18)

The solution is to manually create a 'types' folder in the location you are running the command. Seems to be caused by mkdir not working recursively.