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

jsonutillhelper

v1.0.4

Published

npm init --------------------------------------- Testing your package To reduce the chances of publishing bugs, we recommend testing your package before publishing it to the npm registry. To test your package, run npm install with the full pat

Downloads

2

Readme

npm init

Testing your package
To reduce the chances of publishing bugs, we recommend testing your package before publishing it to the npm registry. To test your package, run npm install with the full path to your package directory:


npm install path/to/my-package
Publishing unscoped public packages
On the command line, navigate to the root directory of your package.


cd /path/to/package
To publish your public package to the npm registry, run:


npm publish
Note: If you use GitHub Actions to publish your packages, you can generate provenance information for each package you publish. For more information, see "Generating provenance statements."

Creating and publishing scoped public packages
Table of contents
Creating a scoped public package
Reviewing package contents for sensitive or unnecessary information
Testing your package
Publishing scoped public packages
To share your code publicly in a user or organization namespace, you can publish public user-scoped or organization-scoped packages to the npm registry.


Creating a scoped public package
If you are using npmrc to manage accounts on multiple registries, on the command line, switch to the appropriate profile:


npmrc <profile-name>
On the command line, create a directory for your package:


mkdir my-test-package
Navigate to the root directory of your package:


cd my-test-package
If you are using git to manage your package code, in the package root directory, run the following commands, replacing git-remote-url with the git remote URL for your package:


git init
git remote add origin git://git-remote-url
In the package root directory, run the npm init command and pass the scope to the scope flag:

For an organization-scoped package, replace my-org with the name of your organization:


npm init --scope=@my-org
For a user-scoped package, replace my-username with your username:


npm init --scope=@my-username
Respond to the prompts to generate a package.json file. For help naming your package, see "Package name guidelines".

Create a README file that explains what your package code is and how to use it.

In your preferred text editor, write the code for your package.

Reviewing package contents for sensitive or unnecessary information
Publishing sensitive information to the registry can harm your users, compromise your development infrastructure, be expensive to fix, and put you at risk of legal action. We strongly recommend removing sensitive information, such as private keys, passwords, personally identifiable information (PII), and credit card data before publishing your package to the registry.

For less sensitive information, such as testing data, use a .npmignore or .gitignore file to prevent publishing to the registry. For more information, see this article.

Testing your package
To reduce the chances of publishing bugs, we recommend testing your package before publishing it to the npm registry. To test your package, run npm install with the full path to your package directory:


npm install my-package
Publishing scoped public packages
By default, scoped packages are published with private visibility. To publish a scoped package with public visibility, use npm publish --access public.

On the command line, navigate to the root directory of your package.


cd /path/to/package
To publish your scoped public package to the npm registry, run:


npm publish --access public
Note: If you use GitHub Actions to publish your packages, you can generate provenance information for each package you publish. For more information, see "Generating provenance statements."

To see your public package page, visit https://npmjs.com/package/\*package-name\*, replacing *package-name* with the name of your package. Public packages will say public below the package name on the npm website.