This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git init # initialise Git repository | |
git add . # add new files | |
git commit -m "Initial Commit" # save the state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"bin": "./server.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install - global |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my-cli | |
/Users/Alex/.nvm/versions/node/v10.11.0/bin/my-cli: line 1: syntax error near unexpected token `'Hello, World!'' | |
/Users/Alex/.nvm/versions/node/v10.11.0/bin/my-cli: line 1: `console.log('Hello, World!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
console.log('Hello, World!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"name": "my-cli", | |
"version": "1.0.0", | |
"description": "My First Node.js CLI", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const { description, name, version } = require('./package.json') | |
const VERSION_MESSAGE = `${name} ${version}` | |
const HELP_MESSAGE = `${VERSION_MESSAGE} | |
${description} | |
Usage: | |
--help Help documentation | |
--version Installed package version` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const { description, name, version } = require('./package.json') | |
const options = process.argv.slice(2) | |
const VERSION_MESSAGE = `${name} ${version}` | |
const HELP_MESSAGE = `${VERSION_MESSAGE} | |
${description} | |
Usage: | |
--help Help documentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my-cli@1.0.0 | |
My First Node.js CLI | |
Usage: | |
--help Help documentation | |
--version Installed package version | |
[ '/Users/Alex/.nvm/versions/node/v10.11.0/bin/node', | |
'/Users/Alex/.nvm/versions/node/v10.11.0/bin/my-cli', | |
'test=me', | |
'option' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"name": "quizme", | |
"version": "1.0.0", | |
"description": "My command-line quiz", | |
"main": "quizme.js", | |
"bin": "quizme.js", |