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

csnpm-cli

v1.2.8

Published

csnpm-cli3 ==========

Readme

csnpm-cli

  • cli for csnpm-server
  • NOT compatible with npm, MUST be used with csnpm-server

install

  • npm install csnpm-cli2 -g

if no server

  • wget https://<dnload-server-domain-hostname>/package/tgz?name=csnpm-cli&version=1.0.7 -o csnpm-cli.tgz

init install

            scp <user@scp-domain-hostname>://upload/csnpm-cli.tar csnpm-cli.tar
            tar -zxf csnpm-cli.tar
            rm csnpm-cli.tar
            cd csnpm-cli/csnpm-cli
            npm install . -g

usage

		csnpm login|publish|search|install|dnload  [options]
		Usage:  [options] 
		Options:
		    -u, --uname                     <username>:<password>
		    -n, --pkg_name                  pkg nameto be installed
		    -p, --path                      install path
		    -t, --ptrn                      search ptrn
		    -s, --url                       server url
		    -v, --version                   version
		    -o, --offset                    offset for search,default 0
		    -l, --limit                     limit for search, default 1024
		    -i, --info_only                 get info only when install, default false
		    -d, --depby_only                get dependanted by info only when install, default false
		    -N, --bynpm_if_not_found        try to find from npm if NOT find from csnpm
		    -h, --help                      usage

example

.csnpm-ignore

   module.exports = (rel_path/*相对要安装的项目的路径*/) => {
       if(rel_path.includes("node_modules")) {
		   return(true)
 	       } else {
		   return(false)
       }
   }

login , only need do 【JUST-ONE-TIME】

  • login -s <server-base-url> -u <username>:<password>
  • csnpm is for local/vpn using , so it using a weak password

    # csnpm login -s http://192.168.1.146:28084 -u admin:admin
	{
	  uname: 'admin:admin',
	  url: 'http://192.168.1.146:28084',
	  utoken: '8f6001375908a74e39980b221277e49acad31ddacc7469ad8822c341c5861f31d5b8677f'
	}

search

  • csnpm search -t <search-text-ptrn> -o <offset =0> -l <limit=1024>

	# csnpm search -t pg
	csnpm install pg                      8.11.3    PostgreSQL client - pure javascript & libpq with the same API
	csnpm install pg-pool                 3.6.1     Connection pool for node-postgres
	csnpm install pg-int8                 1.0.1     64-bit big-endian signed integer-to-string conversion
	csnpm install pg-types                4.0.1     Query result type converters for node-postgres
	csnpm install pg-numeric              1.0.2     reads PostgreSQL binary format for numeric values into a string
	csnpm install pg-protocol             1.6.0     The postgres client/server binary protocol, implemented in TypeScript
	csnpm install pgpass                  1.0.5     Module for reading .pgpass
	csnpm install pg-connection-string    2.6.2     Functions for dealing with a PostgresSQL connection string   

install info

  • csnpm install -i -n pg # only get install info but NOT do install: dependant-on
  • csnpm install -d -n pg # only get install info but NOT do install: dependanted-by
  • RtrnType {[<pkgname>+<semver>]: [<pkgname>, <internal-version>, <semver>]}
  • it maybe SLOW IF packaghe NOT exists in local-server: it will try to find and download it FROM npm

		root@dev:/home/CSNPM-TEST# csnpm install -i -n pg
		
			{
			  'pg::8.11.3': [
				'pgpass::1.0.5',
				'pg-pool::3.6.1',
				'pg-types::2.2.0',
				'pg-protocol::1.6.0',
				'buffer-writer::2.0.0',
				'packet-reader::1.0.0',
				'pg-connection-string::2.6.2'
			  ],
			  'pgpass::1.0.5': [ 'split2::4.2.0' ],
			  'pg-types::2.2.0': [
				'pg-int8::1.0.1',
				'postgres-date::1.0.7',
				'postgres-array::2.0.0',
				'postgres-bytea::1.0.0',
				'postgres-interval::1.2.0'
			  ],
			  'postgres-interval::1.2.0': [ 'xtend::4.0.2' ],
			  'pg-pool::3.6.1': null,
			  'pg-protocol::1.6.0': null,
			  'buffer-writer::2.0.0': null,
			  'packet-reader::1.0.0': null,
			  'pg-connection-string::2.6.2': null,
			  'split2::4.2.0': null,
			  'pg-int8::1.0.1': null,
			  'postgres-date::1.0.7': null,
			  'postgres-array::2.0.0': null,
			  'postgres-bytea::1.0.0': null,
			  'xtend::4.0.2': null
			}


		root@dev:/home/CSNPM-TEST# csnpm install -d -n pg

			DepCache {
			  'pg::8.11.3': [ 'pg', '8.11.3', null ],
			  'pgpass::1.0.5': [ 'pgpass', '1.0.5', 'pg::8.11.3' ],
			  'pg-pool::3.6.1': [ 'pg-pool', '3.6.1', 'pg::8.11.3' ],
			  'pg-types::2.2.0': [ 'pg-types', '2.2.0', 'pg::8.11.3' ],
			  'pg-protocol::1.6.0': [ 'pg-protocol', '1.6.0', 'pg::8.11.3' ],
			  'buffer-writer::2.0.0': [ 'buffer-writer', '2.0.0', 'pg::8.11.3' ],
			  'packet-reader::1.0.0': [ 'packet-reader', '1.0.0', 'pg::8.11.3' ],
			  'pg-connection-string::2.6.2': [ 'pg-connection-string', '2.6.2', 'pg::8.11.3' ],
			  'split2::4.2.0': [ 'split2', '4.2.0', 'pgpass::1.0.5' ],
			  'pg-int8::1.0.1': [ 'pg-int8', '1.0.1', 'pg-types::2.2.0' ],
			  'postgres-date::1.0.7': [ 'postgres-date', '1.0.7', 'pg-types::2.2.0' ],
			  'postgres-array::2.0.0': [ 'postgres-array', '2.0.0', 'pg-types::2.2.0' ],
			  'postgres-bytea::1.0.0': [ 'postgres-bytea', '1.0.0', 'pg-types::2.2.0' ],
			  'postgres-interval::1.2.0': [ 'postgres-interval', '1.2.0', 'pg-types::2.2.0' ],
			  'xtend::4.0.2': [ 'xtend', '4.0.2', 'postgres-interval::1.2.0' ]
			}

install

  • csnpm install -n pg # install in current dir
  • csnpm install -n pg -p <install-to-path> # install in specific dir
  • RtrnType {workdir:<String>, before_already_installed:Array<EleType>, success_newly_installed:Array<EleType>, fail_to_install:Array<EleType>}
  • EleType {pkgnm:<String>, version:<semver>,already_installed:<Boolean>,new_installed:<Boolean>,installed_dir:<PathString>}

 # cd /home/CSNPM-TEST 
 # csnpm install -n pg
	{
	  workdir: '/home/CSNPM-TEST',
	  before_already_installed: [],
	  success_newly_installed: [
		{
		  pkgnm: 'pg',
		  version: '8.11.3',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/pg'
		},
		{
		  pkgnm: 'pgpass',
		  version: '1.0.0',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/pgpass'
		},
		{
		  pkgnm: 'pg-pool',
		  version: '3.6.1',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/pg-pool'
		},
		{
		  pkgnm: 'pg-types',
		  version: '2.1.0',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/pg-types'
		},
		{
		  pkgnm: 'pg-protocol',
		  version: '1.6.0',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/pg-protocol'
		},
		{
		  pkgnm: 'buffer-writer',
		  version: '2.0.0',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/buffer-writer'
		},
		{
		  pkgnm: 'packet-reader',
		  version: '1.0.0',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/packet-reader'
		},
		{
		  pkgnm: 'pg-connection-string',
		  version: '2.6.2',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/pg-connection-string'
		},
		{
		  pkgnm: 'split',
		  version: '1.0.0',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/split'
		},
		{
		  pkgnm: 'pg-int8',
		  version: '1.0.1',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/pg-int8'
		},
		{
		  pkgnm: 'postgres-date',
		  version: '1.0.4',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/postgres-date'
		},
		{
		  pkgnm: 'postgres-array',
		  version: '2.0.0',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/postgres-array'
		},
		{
		  pkgnm: 'postgres-bytea',
		  version: '1.0.0',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/postgres-bytea'
		},
		{
		  pkgnm: 'postgres-interval',
		  version: '1.1.0',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/postgres-interval'
		},
		{
		  pkgnm: 'through',
		  version: '2.0.0',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/through'
		},
		{
		  pkgnm: 'xtend',
		  version: '4.0.0',
		  already_installed: true,
		  new_installed: true,
		  installed_dir: '/home/CSNPM-TEST/node_modules/xtend'
		}
	  ],
	  fail_to_install: []
	}

publish

  • csnpm publish # default current dir
  • csnpm publish -p <path>

  #npm version patch
  #csnpm publish
     success
     and then you can check the install info using 【csnpm install -i -n   】 before install 
  
  # csnpm install -i -n "csnpm-cli"
	{
	  'csnpm-cli1.0.5': [ 'csnpm-cli', '4294967301', '1.0.5' ],
	  'nvison1.0.28': [ 'nvison', '4294967324', '1.0.28' ],
	  'semver7.5.4': [ 'semver', '30065098756', '7.5.4' ],
	  ....
	  'nv-string-basic1.0.21': [ 'nv-string-basic', '4294967317', '1.0.21' ]
	}

dnload JUST DOWNLOAD a EXACT -n <pkgname> -v <semver>

  • csnpm dnload -n <pkgname> -v <version> #default download to current dir
  • csnpm dnload -n <pkgname> -v <version> -p <download-to-path>

 # csnpm dnload -n obuf  -v 1.0.0
       success download to /home/CSNPM-TEST/obuf-1.0.0.tgz
 # ls -l
   total 4
   -rw-r--r-- 1 root root 2824 Jan  7 04:10 obuf-1.0.0.tgz

deploy server

	Usage: csnpm_deploy_server [options]
	Options:
		-p, --install_path          install_path,default ./
		-i, --pg_ip                 postgres ip,default 127.0.0.1
		-r, --redis_ip              redis ip,default 127.0.0.1
		-R, --redis_db              redis dbnum, default 2
		-f, --filepath              storage path, default /home/data/csnpm
		-P, --port                  web port,default 28084
		-c, --enable_console        enable log, default false
		-h, --help                  usage

csnpm publish as nest dir

    #for test only

	Usage: csnpm_publish_as_nest_dir [options]
	Options:
		-p, --from_path        publish_from,default ./
		-h, --help             usage

LICENSE

  • ISC