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

censorify_daviddemo

v0.1.1

Published

Censors words out of text

Readme

How To CREATE, PUBLISH, And USE a Basic Node Package Module

CREATE

The following steps take you through the process of building a Node.js Packaged Mdoule using an example called censorify. The censorify module accepts text and then replaces certain words with asterisks:

  • Create a project folder named .../censorify

  • Inside, create a file named censortext.js

  • Copie this code inside censortext.js

var censoredWords = [
	"sad",
	"bad",
	"mad"
];

var customCensoredWords = [];

function censor ( inStr ) {
	for ( idx in censoredWords ) {
		inStr = inStr.replace( censoredWords[idx], "****" );
	}
	for ( idx in customCensoredWords ) {
		inStr = inStr.replace( customCensoredWords[idx], "****" );
	}
	return inStr;
}

function addCensoredWord ( word ) {
	customCensoredWords.push( word );
}

function getCensoredWords () {
	return censordWords.concat( customCensoredWords );
}

exports.censor = censor;
exports.addCensoredWord = addCensoredWord;
exports.getCensoredWords = getCensoredWords;
  • Create a package.json file, then define it.

  • Create a file README.md in the .../censorify folder. (Instruction to the module)

  • Navigate to the .../censorify folder in a console window and run the npm pack command to build a local package module

  • The npm pack command creates a censorify-0.1.1.tgz file in the .../censorify folder. This is your first Node.js Packaged Module.

PUBLIHING

The following steps describe the process of publishing the module to the NPM registry. These steps assume that you have completed steps 1 through 5 from the previous section:

  • Create a public repository to contain the code for the module. Then push the content of the .../censorify folder up to that location. The following is an example of a Github repository URL:

https://github.com/username/projectname/directoryName/Censorify

  • Create an account at https://npmjs.org/signup

  • Use npm adduser command from a console prompt to add the user you created to the environment

  • Type in the username, password and email that you used to create the account in step 2

  • Modify the package.json file to include the new repository information and any keywords that you want made available in the registry search as shown:

{
    "author": "David-Alexandre",
    "name": "censorify",
    "version": "0.1.1",
    "description": "Censors words out of text",
    "main": "censortext",
    "repository": {
        "type": "git",
        "url": "[email protected]:EchoAppleTree/node-mongodb-angular-learn.git"
    },
    "keywords": [
        "censor",
        "words"
    ],
    "dependencies": {},
    "engines": {
        "node": "*"
    }
}
  • Publish the module using the following command from the .../censorify folder in the console: npm publish

Once the package has been published you can search for it on the NPM registry and use the npm install command to install it into your environment.

To remove a package from the registry make sure that you have addes a user with rights to the module to the envrironment using npm adduser and then execute the following command: npm unpublish <project name>

For example, the following command unpublished the censorify module: npm unpublished censorify

In some instances you cannot unpublished the module without using the --force option. This option forces the removal and deletion of the module from the registry. For example: npm unpublish censorify --force