Node CLI starter on TypeScript which is testing by Jest
- cli
- commander
- jest
- mock
- node
- starter
- template
- typescript
- levioza - original code
- Alexander Lapygin - adaptation to Jest and Soft Spiders
levioza's nodejs-cli-starter-template
npm i
Run
npm test
Should see:
> node-cli-starter@0.1.0 test ${YOUR_PATH}/node-cli-ts-starter
> jest
PASS src/__tests__/writer-spec.ts
Writer
#write()
√ should write a message (5ms)
√ should write a default message (1ms)
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 5.733s
Ran all test suites.
npm run build
npm i -g
cli-command
or
cli-command -h
Should see:
Usage: cli-command [options] [command]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
write [message] say hello!
help [cmd] display help for [cmd]
Run
cli-command -V
Should see:
1.0.0
Licensed under the MIT license.