npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nzp-cli

v1.2.2

Published

A Node.js CLI tool

Downloads

11

Readme

nzp-cli

A Node.js CLI tool that can be installed and used directly from the terminal.

Installation

Global Installation

npm install -g nzp-cli

Local Installation

npm install nzp-cli

Usage

Interactive Mode (Recommended)

Enter the interactive mode for a better experience:

# Start interactive mode (default)
nzp-cli

# Or explicitly start interactive mode
nzp-cli interactive
# or
nzp-cli i

Once in interactive mode, you'll see a prompt:

nzp-cli> 

You can then type commands directly:

nzp-cli> hello World
Hello, World!

nzp-cli> echo This is a test
This is a test

nzp-cli> calc 2 + 2
2 + 2 = 4

nzp-cli> help
Available commands:
  calc      Simple calculator
  clear     Clear the screen
  echo      Echo your message
  exit      Exit the interactive mode
  help      Show available commands
  hello     Say hello
  info      Show CLI information
  quit      Exit the interactive mode
  version   Show version information

nzp-cli> exit
Goodbye! 👋

Command Mode

You can also use commands directly without entering interactive mode:

# Show help
nzp-cli --help

# Show version
nzp-cli --version

# Say hello
nzp-cli hello

# Say hello with a name
nzp-cli hello --name "Your Name"

# Show CLI information
nzp-cli info

Development

If you want to develop this CLI tool locally:

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Link the package globally for testing:
    npm link
  4. Now you can use nzp-cli command anywhere

Using as a Module

You can also use nzp-cli as a Node.js module in your projects:

Installation

npm install nzp-cli

Usage Examples

CommonJS

const { calc, hello, echo, getInfo } = require('nzp-cli');

// Calculator
const result = calc('2 + 2'); // Returns 4
const product = calc('10 * 5'); // Returns 50

// Hello
const greeting = hello('Alice'); // Returns "Hello, Alice!"
const defaultGreeting = hello(); // Returns "Hello, World!"

// Echo
const message = echo('Hello', 'World'); // Returns "Hello World"

// Get Info
const info = getInfo();
console.log(info);
// {
//   name: 'nzp-cli',
//   version: '1.2.0',
//   description: 'A Node.js CLI tool',
//   nodeVersion: 'v18.0.0',
//   platform: 'darwin'
// }

Error Handling

const { calc } = require('nzp-cli');

try {
  const result = calc('2 + 2');
  console.log(result); // 4
} catch (error) {
  console.error('Calculation error:', error.message);
}

try {
  calc('invalid expression'); // Throws error
} catch (error) {
  console.error(error.message);
  // "Invalid expression. Only numbers and basic operators (+, -, *, /) are allowed."
}

Available Functions

  • calc(expression) - Calculate mathematical expressions
  • hello(name?) - Generate greeting message
  • echo(...messages) - Join messages together
  • getInfo() - Get CLI package information

See examples/usage-example.js for more examples.

Commands

Interactive Mode Commands

When in interactive mode, you can use:

  • hello [name] - Say hello (default: "World")
  • echo <message> - Echo your message
  • calc <expression> - Simple calculator (e.g., calc 2 + 2)
  • info - Show CLI information
  • version - Show version information
  • help - Show available commands
  • clear - Clear the screen
  • exit or quit - Exit interactive mode

Command Mode Commands

  • nzp-cli hello [options] - Say hello
  • nzp-cli info - Show CLI information
  • nzp-cli interactive or nzp-cli i - Start interactive mode

Publishing

To publish this package to npm:

  1. Make sure you have an npm account (sign up at https://www.npmjs.com/signup)
  2. Login to npm: npm login
  3. Check if the package name is available
  4. Publish: npm publish

For detailed publishing instructions, see PUBLISH.md.

License

MIT