https://github.com/jimlynchcodes/jims-derp-cli
A public npm package that prints "derp" to the console.
https://github.com/jimlynchcodes/jims-derp-cli
Last synced: about 1 year ago
JSON representation
A public npm package that prints "derp" to the console.
- Host: GitHub
- URL: https://github.com/jimlynchcodes/jims-derp-cli
- Owner: JimLynchCodes
- License: gpl-3.0
- Created: 2019-12-30T02:48:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T19:23:34.000Z (over 3 years ago)
- Last Synced: 2025-03-29T10:16:41.454Z (about 1 year ago)
- Language: JavaScript
- Size: 2.04 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jim's Derp CLI
A cute little command line tool that prints "derp" to the console.
# Usage
Please use node version `8.16.0`ย or later.
First, install the derp cli globally:
```
npm i -g jims-derp-cli
```
Then just run it:
```
jims-derp-cli
```
# Optional Flags
Any one of these flags or their aliases may be added to get a more interesting output...
`--politely, -p` - Prints derp politely.
`--forcefully, -f` - Prints derp forcefully.
`--very-forcefully, -e` - Prints derp very forcefully.
`--extremely-forcefully, -x` - Prints derp extremely forcefully.
These basic options are also supported:
`--version, -v` - Show version number.
`--help` - Show help
For example:
```
jims-derp-cli -p
```
# Key Takeaways For Making Your Own CLI
- Add "bin" to your package.json:
```
"bin": {
"jims-derp-cli": "./bin/index.js"
},
```
- Make it a "default command" with the [$0 argument](https://github.com/JimLynchCodes/jims-derp-cli/blob/master/bin/index.js#L39) in the yargs library:
```
.command('$0', 'Prints "derp" to the console.', () => { }, (argv) => {
```
- Shows how to add aliases for your custom commands and for the yargs builtin `--version` ([here](https://github.com/JimLynchCodes/jims-derp-cli/blob/master/bin/index.js#L6_L37)).
- Publish your own npm packages with:
```
npm publish
```
# Enjoy!
Hopefully this helps you somehow! ๐
Much thanks and best regards,
[Jim](https://github.com/JimLynchCodes)