@s54a/hi

1.0.0 • Public • Published

hi

Hello world CLI Package which uses Node JS

I built this to learn how to make CLI Apps with Node JS

Watch this video to learn more

Video Tutorial

Source Code

#!/usr/bin/env node
console.log("hello, how are you?");

const argv = process.argv;

const [, , ...args] = process.argv;

if (args.length === 0) {
  process.exit(1);
} else {
  console.log(args);
}

Output

Command to run the CLI Script or App = hi Ouptut =

hello, how are you?

Command with Arguments = hi t e s t Ouptut =

hello, how are you?
[ 't', 'e', 's', 't' ]

Command with Arguments = hi test Ouptut =

hello, how are you?
[ 'test' ]

Readme

Keywords

none

Package Sidebar

Install

npm i @s54a/hi

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

1.31 kB

Total Files

3

Last publish

Collaborators

  • s54a