Updates on 106-nodejs-command-line-apps (#6087)

* updates on 106-nodejs-command-line-apps

* Apply suggestions from code review

Slight style and guideline editting

---------

Co-authored-by: dsh <daniel.s.holdsworth@gmail.com>
pull/6096/head
Abdallah Gaber 5 months ago committed by GitHub
parent 5aa67c2e2b
commit ec175482bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      src/data/roadmaps/nodejs/content/106-nodejs-command-line-apps/101-printing-output/100-process-stdout.md
  2. 2
      src/data/roadmaps/nodejs/content/106-nodejs-command-line-apps/101-printing-output/101-process-stderr.md
  3. 2
      src/data/roadmaps/nodejs/content/106-nodejs-command-line-apps/101-printing-output/102-chalk.md
  4. 2
      src/data/roadmaps/nodejs/content/106-nodejs-command-line-apps/102-taking-input/100-process-stdin.md
  5. 3
      src/data/roadmaps/nodejs/content/106-nodejs-command-line-apps/103-command-line-args/100-process-argv.md
  6. 8
      src/data/roadmaps/nodejs/content/106-nodejs-command-line-apps/103-command-line-args/index.md
  7. 4
      src/data/roadmaps/nodejs/content/106-nodejs-command-line-apps/104-environment-variables/100-dotenv.md
  8. 3
      src/data/roadmaps/nodejs/content/106-nodejs-command-line-apps/104-environment-variables/101-process-env.md
  9. 4
      src/data/roadmaps/nodejs/content/106-nodejs-command-line-apps/104-environment-variables/index.md
  10. 1
      src/data/roadmaps/nodejs/content/106-nodejs-command-line-apps/index.md

@ -1,7 +1,9 @@
# Process stdout
The process.stdout property is an inbuilt application programming interface of the process module which is used to send data out of our program. A Writable Stream to stdout. It implements a write() method.
The `process.stdout` property is an inbuilt application programming interface of the process module which is used to send data out of our program. A Writable Stream to stdout. It implements a `write()` method.
`console.log()` prints to the `process.stdout.write()` with formatted output or new line.
Visit the following resources to learn more:
- [@official@process.stdout](https://nodejs.org/api/process.html#processstdout)
- [@article@process.stdout vs console.log](https://stackoverflow.com/questions/4976466/difference-between-process-stdout-write-and-console-log-in-node-js/4984464#4984464)

@ -1,6 +1,6 @@
# process.stderr
The `process.stderr` is an inbuilt application programming interface of class Process within process module which is used to returns a stream connected to stderr.
The `process.stderr` property is an inbuilt application programming interface of the process module that returns a stream connected to the Standard Error Stream (`stderr`). `console.error()` prints to `process.stderr.write()` with formatted output or a new line. This stream is connected to file descriptor 2 (fd `2`), which is conventionally used for error messages and diagnostics.
Visit the following resources to learn more:

@ -1,6 +1,6 @@
# Chalk
Chalk is a clean and focused library used to do string styling in your terminal applications. With it you can print different styled messages to your console like changing font colors, font boldness, font opacity and also the background of any message printed on your console.
Chalk is a clean and focused library used to do string styling in your terminal applications. With it, you can print different styled messages to your console such as changing font colors, font boldness, font opacity, and the background of any message printed on your console.
Visit the following resources to learn more:

@ -1,6 +1,6 @@
# Process stdin
The process.stdin is a standard Readable stream which listens for user input and is accessible via the process module. It uses on() function to listen for input events.
The `process.stdin` is a standard Readable stream which listens for user input and is accessible via the process module. It uses `on()` function to listen for input events.
Visit the following resources to learn more:

@ -4,4 +4,5 @@
Visit the following resources to learn more:
- [@official@Node.js Docs on process.argv](https://nodejs.org/docs/latest/api/process.html)
- [@official@Node.js Docs on process.argv](https://nodejs.org/docs/latest/api/process.html#processargv)
- [@video@Command Line Arguments - Cave of Programming](https://youtu.be/nr7i2HOAjeE)

@ -1,5 +1,7 @@
# Command line args
- [@article@How To Handle Command-line Arguments in Node.js Scripts](https://www.digitalocean.com/community/tutorials/nodejs-command-line-arguments-node-scripts)
- [@official@Node Documentation](https://nodejs.org/docs/latest/api/process.html#processargv)
- [@video@Command Line Arguments ](https://youtu.be/5d7eltp0-xm)
In the CLI (Command Line Interface) world, command line arguments (args) provide additional information to a Node.js program when executed, enabling flexibility and customization. They are managed using `process.argv` in Node.js, or with npm packages like `commander.js` and `yargs` for enhanced argument parsing.
Visit the following resources to learn more:
- [@article@How To Handle Command-line Arguments in Node.js Scripts](https://www.digitalocean.com/community/tutorials/nodejs-command-line-arguments-node-scripts)

@ -1,9 +1,11 @@
# dotenv
dotenv is a zero-dependency module that loads environment variables from a `.env` file into [process.env](https://nodejs.org/docs/latest/api/process.html#process_process_env). Storing configuration in the environment separate from code is based on [The Twelve-Factor App methodology](https://12factor.net/config).
dotenv is a zero-dependency module that loads environment variables from a `.env` file into `process.env`. Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology.
Visit the following resources to learn more:
- [@article@The Twelve-Factor App Methodology](https://12factor.net/config)
- [@official@process.env Documentation](https://nodejs.org/docs/latest/api/process.html#process_process_env)
- [@opensource@dotenv Docs](https://github.com/motdotla/dotenv#readme)
- [@official@Dotenv package](https://www.npmjs.com/package/dotenv)
- [@article@Dotenv tutorial](https://zetcode.com/javascript/dotenv/)

@ -4,4 +4,5 @@ In Node. js, process. env is a global variable that is injected during runtime.
Visit the following resources to learn more:
- [@article@Process.env Node](https://www.knowledgehut.com/blog/web-development/node-environment-variables)
- [@official@Node.js Learn environment variables](https://www.digitalocean.com/community/tutorials/nodejs-command-line-arguments-node-scripts)
- [@article@Process.env Node](https://www.knowledgehut.com/blog/web-development/node-environment-variables)

@ -1,4 +1,8 @@
# Environment variables
Environment variables in Node.js are key-value pairs used to configure applications based on their runtime environment. Accessed via `process.env`, they enable developers to manage settings, handle sensitive data securely, and adapt application behavior across various deployment environments such as development, testing, and production. Tools like `dotenv` simplify loading environment variables from a `.env` file, enhancing configuration management in Node.js applications.
Visit the following resources to learn more:
- [@official@Node.js Learn environment variables](https://www.digitalocean.com/community/tutorials/nodejs-command-line-arguments-node-scripts)
- [@article@Node.js Everywhere with Environment Variables!](https://medium.com/the-node-js-collection/making-your-node-js-work-everywhere-with-environment-variables-2da8cdf6e786)

@ -4,7 +4,6 @@ Command Line Applications are applications that can be run from the command line
Visit the following resources to learn more:
- [@article@Intro To CLI Applications](https://learn.co/lessons/intro-to-cli-applications)
- [@article@Build a Command Line Application with Node.js](https://developer.okta.com/blog/2019/06/18/command-line-app-with-nodejs)
- [@video@ 5-Minute Node.js CLI Project](https://www.youtube.com/watch?v=_oHByo8tiEY)
- [@feed@Explore top posts about Node.js](https://app.daily.dev/tags/nodejs?ref=roadmapsh)

Loading…
Cancel
Save