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

npmsvr

v0.1.0

Published

Simpler command line interface for `npm-server` registry simulator. Helps test NodeJS libs/apps prior to performing `npm publish`.

Downloads

2

Readme

Description

npmsvr is a tiny front end to npm and npm-server that saves you keystrokes when testing NodeJS apps and libs prior to publishing them to the npm registry.

$ npmsvr on      // Registers local registry server
$ npmsvr start   // Start local registry server
$ npmsvr off     // Deregisters local registry server`

I've forked npm-server and started rewrite to use cli-config that will implement this command line interface but for now we just install the two apps npmsvr and npm-server.

Installation

$ [sudo] npm install -g npm-server
$ [sudo] npm install -g npmsvr

Using npmsvr to test node apps before publishing to npm registry

In order to fully test the package configuration and ensure that modules behave as they will on the final deployment I now use the following procedure. It completely avoids the need to hack your node_module directories or require() code so when you go to deploy it just works.

For internal projects or pre-release to github you also might want to prevent accidental publication by anyone in your team by setting "private": true in your package.json so npm will then refuse to publish it.

  1. Create a project directory under git version control and add all your node modules as subdirectories. Subdirectory names must match their package names. If you're working with github, you will want to create a separate git repo for each module directory. They can be git submodules in your project repo. Add node_module to your .gitignore files.

  2. Used npmsvr to set your npm registry to localhost so now npm will talk to your local npm server to fetch packages. Any it finds as subdirectories it will send. Any it does not find it will proxy to registry.npmjs.org . ` $ npmsvr on $ cd ~/projects $ npmsvr start

  3. Start a new shell and create a separate sandbox directory $ mkdir sandbox $ cd sandbox

  4. Install your app using your local registry server. Clear local npm cache and reinstall your app. I do this on one line so it's easy to redo via the shell. You might want to script it.

    $ npm cache clear; sleep 3; npm uninstall -g myapp; sleep 3; npm install -g myapp

  5. Test your app:

    $ myapp ....

  6. Deregister local npm registry when you're done installing:

    $ npmsvr off

  7. Once you've completed testing you can publish your app and retest the deployment with npm-server stopped.

$ cd ~/projects $ npm publish app


Rather than register & deregister your local server, you can just use the localhost server for a one off install: $ npm --registry=http://localhost:6070/ install app