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 🙏

© 2024 – Pkg Stats / Ryan Hefner

prajwal-whoami

v1.0.5

Published

About me

Downloads

2

Readme

How to create your own Package executor

Having a node package for your introduction would be a cool way to flex your skills and also would help you to stand out amongst the crowd.

Creating and publishing your npm package is rather an easy task, however there are few prerequisites one needs to meet.

Prerequisites

Setting up the project

You can either fork and clone this repository, make the necessary changes and publish it (OR) Initialize the project, configure the necessary files, test locally, and publish it.

1. Clone this repository and make the necessary changes

If you're cloning this repository, there are only a few changes you'd need to make. Delete package.json and yarn.lock. Set up your remote origin pointing to the forked repository. Run npm init and enter the required details. After your package.json is generated. Add the below configuration properties to it:

  "bin": "./bin.js",
  "dependencies": {
    "yargs": "^17.7.2"
  },
  "publishConfig": {
    "access": "public"
  }

Run yarn install

Note: This project uses yarn. So make sure you've yarn installed.

Update data.js with your information, and to generate cool ASCII texts, you can use this website.

To test things locally, run npx . from the project directory.

Publishing

Publishing your package to npm is pretty straightforward, as there's a workflow already setup that publishes your changes when you commit your changes on the remote main branch. Before pushing your changes, you'd have to add your access token to your repository. You can obtain your access token from the npm website by clicking on your profile > access tokens > generate new token.

Add this token to your repository by navigating to your project > settings > secrets and variables(present on the left pane) > Actions > New repository secret > set the key as npm_token.

There you have it, run your package by executing npx <your-package-name>

2. Initialize the project from scratch

Get started by running npm init and enter the required details.

Once the package.json file is created, add the bin property and point it to your bin.js file.

Whenever the command npx <your-package-name> is executed, it is the bin file that runs. So, anything that'd you'd want to show on running the command should go into this file.

To support passing arguments and reading them, you may have to use a dependency like yargs.

Additionally, you can also add a workflow that publishes your package to the npm registry. You may refer to the workflow defined in this project by navigating to .github/workflows/npm-publish.yml.

Liked the project? Give it a :star:

Learned something new? Consider giving this repo a :star:. It would encourage me to publish more such cool projects. Thank you!