2.0.10 • Published 10 months ago

@s54a/hi v2.0.10

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

hi

Hello world CLI Package which uses Node JS

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

I learnt by watching this video

Video FireShip Tutorial

Preview

Package Preview

How to use

Since this provides an executable you will have to Globally Install the Package.

Running with npm

npm install -g @s54a/hi

Then, you can execute it with:

hi

Running with npx

You can also run the CLI without installing it globally by using npx:

npx @s54a/hi

Source Code

#!/usr/bin/env node

const argv: string[] = process.argv;

const [, , ...args]: string[] = argv;

if (args.length === 0) {
  console.log("hello, how are you?");
} else {
  console.log(args);
}

Output

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

hello, how are you?

Command with Arguments = hi test Output =

[ 'test' ]

Command with Arguments = hi t e s t Output =

[ 't', 'e', 's', 't' ]

File Structure

@s54a/hi
├── dist
│ └── index.js
├── node_modules
├── src
│ └── index.ts
├── .gitignore
├── image.png
├── License
├── package-lock.json
├── package.json
├── Readme.md
└── tsconfig.json

License

This project is licensed under the MIT License - see the LICENSE file for details.


1.0.2

10 months ago

2.0.2

10 months ago

1.0.1

10 months ago

2.0.5

10 months ago

2.0.7

10 months ago

2.0.10

10 months ago

2.0.1

10 months ago

2.0.0

10 months ago

1.0.3

10 months ago

1.0.0

1 year ago