JSPM

dev-utility-cli

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 7
    • Score
      100M100P100Q22316F
    • License MIT

    Developer utility CLI: count, copy, system diagnostics

    Package Exports

      This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dev-utility-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

      Readme

      dev-utility-cli

      A simple, fast, and cross-platform Developer Utility CLI built with Node.js. This tool helps developers perform common tasks directly from the terminal, such as:

      • 📄 Text analysis (lines, words, characters)
      • 📂 File copy operations (cross-platform)
      • 🖥️ System diagnostics

      Designed to be easy to use, beginner-friendly, and production-ready.


      ✨ Features

      • ✅ Count lines, words, and characters in any text file
      • ✅ Copy files from one location to another (Windows, Linux, macOS)
      • ✅ View system diagnostics (OS, CPU, memory, Node.js version)
      • ✅ Clean CLI interface
      • ✅ Proper error handling
      • ✅ Cross-platform path support using Node.js path module

      📦 Installation

      Install globally using npm:

      npm install -g dev-utility-cli

      After installation, the dev command will be available globally.


      🚀 Usage

      General command format:

      dev <command> [arguments]

      📄 Text Analysis (Count Command)

      Analyze a text file and get the number of lines, words, and characters.

      Command

      dev count <file-path>

      Example

      dev count text.txt

      Output

      📄 File Analysis
      ----------------
      Words : 120
      Lines : 10
      Chars : 800

      What it does internally

      • Reads the file using fs.readFile

      • Splits text by:

        • \n for lines
        • spaces for words
      • Uses .length for character count

      • Handles file-not-found (ENOENT) errors gracefully


      📂 File Copy (Copy Command)

      Copy a file from one location to another — similar to copy & paste, but from the terminal.

      Command

      dev copy <source> <destination>

      Example

      dev copy ./data/file.txt ./backup/file.txt

      Output

      ✅ File copied successfully
      From: ./data/file.txt
      To  : ./backup/file.txt

      Highlights

      • Uses cross-platform paths
      • Automatically resolves relative paths
      • Works on Windows, Linux, and macOS

      🖥️ System Diagnostics (System Command)

      Display useful system information.

      Command

      dev system

      Output (example)

      🖥️ System Diagnostics
      ----------------------
      OS        : Windows_NT
      Platform  : win32
      Arch      : x64
      CPU       : Intel(R) Core(TM)
      Cores     : 8
      Memory    : 7.21 GB free / 16.00 GB total
      Node.js   : v20.x.x
      Uptime    : 132 minutes

      🧠 Why this CLI?

      This project was built to:

      • Practice Node.js file system operations
      • Understand CLI architecture
      • Learn cross-platform path handling
      • Build a real npm package
      • Help beginners understand how developer tools are built

      🗂️ Project Structure

      dev-utility-cli/
      │
      ├── bin/
      │   └── index.js        # CLI entry point
      │
      ├── Command/
      │   ├── Count.js        # Text analysis
      │   ├── Copy.js         # File copy
      │   └── System.js       # System diagnostics
      │
      ├── package.json
      ├── README.md

      ⚠️ Error Handling

      • Shows helpful messages when:

        • File path is missing
        • File does not exist (ENOENT)
        • Invalid command is used
      • Prevents crashes and improves CLI experience


      🛠️ Requirements

      • Node.js v18+ recommended
      • npm installed

      🔮 Future Improvements (Roadmap)

      • Multiple file support
      • Folder copy (recursive)
      • --words, --lines, --chars flags
      • JSON output mode
      • Colored output
      • move and delete commands

      👨‍💻 Author

      Zaheer Rahman Backend & CLI Tool Developer


      📄 License

      MIT License You are free to use, modify, and distribute this project.


      ⭐ Final Note

      If you are learning Node.js or want to understand how real CLI tools work, this project is a great starting point.

      Feel free to fork, improve, and contribute 🚀