Skip to content

softspiders/node-cli-commander-ts-jest-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SOFTSPIDERS

node-cli-commander-ts-jest-starter

Node CLI starter on TypeScript which is testing by Jest

Feature tags

  • cli
  • commander
  • jest
  • mock
  • node
  • starter
  • template
  • typescript

Direct ancestors

Node CLI starter


Requirements

NodeJS


Authors

Inspired by

levioza's nodejs-cli-starter-template


Install (download dependencies)

npm i

Test

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.

Build

npm run build

Install as a CLI

npm i -g

Run

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

License

Licensed under the MIT license.