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

luyue

v1.0.1

Published

Personal CLI business card for Luyue Zhang

Downloads

101

Readme

Create NPX Business Card

Open a terminal and type npx luyue to see my business card.

I learned the idea from the article Write a Simple npx Business Card, then made some changes on top of it.

I will share how I accomplished this in detailed instructions below, I hope it will help you build your own CLI project. If you would like to leave a star, thank you!

Feel free to experiment, style it your way, and share it with others. Enjoy!


Before You Start

Your computer must have Node.js installed.

Check it with:

node -v  
npm -v  

If both show version numbers, you are ready!

Tutorial

Create a New Project Folder

Make an empty folder anywhere you like. Inside this folder, run:

npm init -y  

This creates a basic Node project automatically. It generates a package.json file, which keeps project info and settings.

You may find this from your package.json:

"bin": {  
  "luyue": "cli.js"  
}

This tells npm which command to run and which file to execute. If you want your own custom command (e.g. npx your_name), you need to write:

"bin": {  
  "your_name": "cli.js"  
}

Please keep in mind that your_name must be a valid npm command name and must not conflict with existing global commands.

Install Dependencies

We need two packages:

npm install [email protected]  
npm install chalk@4  

These versions work with CommonJS and let us use require() without errors.

Create files

  1. Create the file: lib/data.js. This file will store your personal information. You can follow the structure of my data file or create your own.
  2. Create index.js. This file reads your info and returns your final card string. You can follow my index.js or read the official docs for boxen and chalk if you want to customize the style.
  3. Create cli.js. This file will run when someone types npx your_name.
    At the top of cli.js, add: #!/usr/bin/env node. This tells the system to run the file with Node.
    Then add:
    const { buildCard } = require('./index')  // loads your function from index.js
    console.log(buildCard())  // prints the card
  4. On macOS or Linux, you also need to run: chmod +x cli.js. This makes the file executable (Windows users do not need this).

Test Locally

  1. Run: node cli.js. You should see your card in the terminal.
  2. Optional: When you run npm link, npm registers your package as a global command on your system.
    But, this is only for local testing and is not required for publishing.
    npm link  
    luyue  

Publish to NPM

First, go to npmjs.com and create an account. Then log in from the terminal: npm login.

Now publish your package (first time only): npm publish --access public.

Before publishing your package, you may want to check whether the package name is already taken:

npm view package-name

If the package does not exist, npm will return a 404 error message.

If you want to update your package later after publishing, don't forget to increase the version number in package.json (for example 1.0.0 to 1.0.1), then run npm publish to update your changes.

After you published your package, you may want to check the published version list:

npm view your_package_name versions