Skip to content

saqibbedar/nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js

Node.js is a JavaScript runtime that lets you run JavaScript outside the browser. It is commonly used for backend apps, scripts, and command-line tools.

Prerequisites

node -v
npm -v

Folder Overview

This nodejs folder contains learning material and hands-on CLI examples:

  • 00_Introduction/ - basic Node.js starter content
  • 01_Modules/ - notes and examples for core, custom, and third-party modules
  • cli-2026/ - focused CLI practice series

cli-2026

cli-2026 is organized as a step-by-step CLI learning track.

1) 00_Intro

Purpose:

  • Introduces executable Node scripts using a shebang (#!/usr/bin/env node)
  • Prints a welcome message from index.js

Current package behavior:

  • Package name: bui
  • Bin command: bui

Run locally:

cd cli-2026/00_Intro
npm install
npm start

2) 01_args

Purpose:

  • Demonstrates command-line argument parsing with process.argv
  • Shows full argv and sliced arguments (process.argv.slice(2))

Current package behavior:

  • Bin command is also bui in this lesson

Run locally:

cd cli-2026/01_args
npm install
node index.js hello world

3) projects/00_clrs

Purpose:

  • Builds terminal text styling utilities using ANSI escape codes
  • Includes reusable helpers for:
    • text colors (utils/colors.utils.js)
    • text styles (utils/styles.utils.js)
    • background colors (utils/backgrounds.utils.js)
    • combined formatter (utils/format.utils.js)

Run locally:

cd cli-2026/projects/00_clrs
npm install
node index.js

4) projects/02_mini_cli_frmwk

Purpose:

  • A mini CLI framework that supports basic utility commands

  • Implemented commands:

  • version / --v - reads version from local package.json

  • clear / cls - clears terminal screen

  • ls - lists files and folders in the current working directory

  • lsd - lists only directories in blue text

Run locally:

cd cli-2026/projects/02_mini_cli_frmwk
npm install
npm link
mini-cli version
mini-cli ls
mini-cli lsd

License

MIT License

Copyright (c) Saqib Bedar

About

Learn nodejs from basics to the advance.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors