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

nandu-cli

v1.2.3

Published

Nandu Open NPM Registry CLI

Downloads

24

Readme

nandu

Nandu CLI

Nandu Open NPM Registry CLI

oclif Version Downloads/week License

Quick Start

In order to quickly get a working Nandu NPM registry you can follow this steps and recommendations.

Nandu uses env variables for configuring all its settings, inclusive the ROOT user credentials. The root user is the one that can bootstrap the service, by creating new users and so on. Also the root user has godlike permissions, therefore it is important to only use it for bootstrapping, and the first thing to do is to create a new user and give it "admin" permissions.

When you start Nandu for the first time it will create such root user that you can then use to interact with the registry.

$ nandu start
Nandu is running on port 4567.

You will get a lot of debug logs unless you set NODE_ENV to production.

By default Nandu will use Sqlite for storing the registry metadata, and the database file will be stored at ./storage/db/nandu.db. You can change this setting with the NANDU_SEQUELIZE_URI env variable.

The next step is to create an authentication token for the root user, you need to use the nandu cli for this as well,

$ nandu token:create root
username: root
password: ******

New token created for user root {
  id: 'ad4ac909-2cea-40ba-be4e-03ec4fbb57bf',
  token: 'c0463461-23fb-4642-a927-820b0d71ffb8',
  readonly: false,
  created: '2021-11-11T08:09:47.532Z'
}

You can create tokens on behalf of other users if the user you use for creating the tokens has the correct permissions.

Usage

$ npm install -g nandu-cli
$ nandu COMMAND
running command...
$ nandu (-v|--version|version)
nandu-cli/1.2.3 linux-x64 node-v14.18.2
$ nandu --help [COMMAND]
USAGE
  $ nandu COMMAND
...

Commands

nandu help [COMMAND]

display help for nandu

USAGE
  $ nandu help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

nandu start

Starts Nandu Open NPM Server

USAGE
  $ nandu start

OPTIONS
  -f, --force
  -h, --help       show CLI help
  -p, --port=port  [default: 4567] listen to port

EXAMPLE
  $ nandu start -p 4567

See code: src/commands/start.ts

nandu token

Manage NPM Registry tokens

USAGE
  $ nandu token

EXAMPLE
  $ nandu token:create myuser

See code: src/commands/token/index.ts

nandu token:create USER

create a new token for given user

USAGE
  $ nandu token:create USER

OPTIONS
  -h, --help                       show CLI help
  --cidr-whitelist=cidr-whitelist  comma separated list of whitelisted cidrs
  --readonly                       generate a readonly token
  --registry=registry              (required) URI pointing to your Nandu NPM Registry
  --token=token                    Token to be used for authentication, uses NPM_TOKEN env variable if unspecified

EXAMPLE
  $ nandu start -p 4567

See code: src/commands/token/create.ts

nandu token:ls USER

list tokens for given user

USAGE
  $ nandu token:ls USER

OPTIONS
  -h, --help           show CLI help
  --registry=registry  (required) URI pointing to your Nandu NPM Registry
  --token=token        Token to be used for authentication, uses NPM_TOKEN env variable if unspecified

EXAMPLE
  $ nandu start -p 4567

See code: src/commands/token/ls.ts

nandu user

Manage NPM Registry users

USAGE
  $ nandu user

EXAMPLE
  $ nandu user:add myuser

See code: src/commands/user/index.ts

nandu user:add USER

add or update a new token for given user

USAGE
  $ nandu user:add USER

OPTIONS
  -h, --help           show CLI help
  --registry=registry  (required) URI pointing to your Nandu NPM Registry
  --token=token        Token to be used for authentication, uses NPM_TOKEN env variable if unspecified

EXAMPLE
  $ nandu user:add myuser

See code: src/commands/user/add.ts