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

fe-shared-components-2

v1.0.2

Published

## Preparation 1. You'll need a npm-account. 2. You'll need a git-account. 3. `npm` and `git` must to be installed on your system.

Downloads

2

Readme

Create and update your npm-package

Preparation

  1. You'll need a npm-account.
  2. You'll need a git-account.
  3. npm and git must to be installed on your system.

Create a package

Start your package by using npm init. This will guide you through a quick process. Watch out for these fields:

  • name (required) must be globally unique! To ensure this, its common sense to use namespaces, eg. project-name-package-name.
  • version (required).
  • main (required) starting point, index.js by default.
  • author (optional) format: Your Name <[email protected]> (https://your-website.de)

Next, create a file named like your main-field above (index.js by default). Your code inside must be exported, otherwise you cant use it when including your package. Your file may look like this:

exports.printMyMessage() = function() {
    console.log('Hello World');
}

Create a Readme.md file. This will be used as your default readme for both git and npm.

Your folder structure should now look like this:

  • package-folder
    • package.json
    • index.js
    • Readme.md

At this point you should start your git-repository. Use git init and push to the repository-provider of your choice. Make sure your working directory is clean!

Notice: Like git, everything in your package-folder will be included in your package! You can use a .npmignore-file to exclude certain files or folders as you do with .gitignore.

Login to your npm-account via npm login. Fill in your credentials.

Finally, publish your package by using npm publish.

Done!

Your package is now aviable in your profile (for official npm, this will be https://npmjs.org/~your.username) or directly via https://npmjs.com/packge/your-package-name.

Update your npm-package

  1. Change or add files as you need.
  2. Push your changes to git. Your working directory must be clean!
  3. Update your package-version by using npm version patch. This will increase your version like 1.0.0 to 1.0.1.
  4. Publish updated package using npm publish.