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

@qiwi/nexus-cli

v2.5.0

Published

CLI for managing Nexus NPM repository contents

Downloads

17

Readme

@qiwi/nexus-cli

CLI for managing Nexus NPM repository contents. Deletes and downloads package components.

Installation

You can use this utility without installation, see Usage

yarn add @qiwi/nexus-cli

or

npm i @qiwi/nexus-cli

Usage

You can call this utility without installing:

npx @qiwi/nexus-cli <arguments>

Delete

nexus-cli --auth.username foo --auth.password bar --url baz --data.repo npm --data.name bat --data.group quz --data.range '<2.0.3' --action delete

Download

For this action utility saves tarballs and prints metadata in given cwd

nexus-cli --auth.username foo --auth.password bar --url baz --data.repo npm --data.name foo --data.group qiwi --data.range '<1.0.0' --data.cwd nexus-downloads --action download

Output in nexus-downloads/nexus-cli-downloads-meta-2021-03-17T06:48:21.347Z.json:

[
	{
		"name": " @qiwi/foo",
		"version": "0.2.0",
		"filePath": "/Users/user/projects/platform/nexus/packages/cli/nexus-cli-downloads-2021-03-17T06:48:21.347Z/@qiwi%foo%2F-%foo-0.2.0.tgz"
	},
	{
		"name": " @qiwi/foo",
		"version": "0.6.0",
		"filePath": "/Users/user/projects/platform/nexus/packages/cli/nexus-cli-downloads-2021-03-17T06:48:21.347Z/@qiwi%foo%2F-%foo-0.6.0.tgz"
	}
]

Compare

Options for this action should be given via config

nexus-cli --config compare-config.json

Utility will write list of missing packages and list of extra packages for primary registry in comparison with secondary one.

Output in ${cwd}/missing.json

[
  {
    "group": "null",
    "name": "buildstamp",
    "version": "1.0.2"
  },
  {
    "group": "null",
    "name": "buildstamp",
    "version": "1.2.2"
  },
  {
    "group": "null",
    "name": "buildstamp",
    "version": "1.3.0"
  }
]

Output in ${cwd}/extra.json

[
  {
    "group": "null",
    "name": "buildstamp",
    "version": "1.0.1",
  }
]

With config file:

nexus-cli --config some/path/config.json

With config file and overriding

nexus-cli --config some/path/config.json --data.repo npm --data.name bat --data.group quz --data.range '<2.0.3'

Options

Common

| Option | Description | |---------------------------------------------|--------------------------------------------------| | auth.username, auth.password | Nexus API credentials, optional if action is 'compare' | | url | Nexus API URL, optional if action is 'compare' | | batch.rateLimit | Components API deleteComponent method multiple call limit. If exists, limitation will be applied. See more at push-it-to-the-limit. | | config | path to config file
| action | one of delete, download | By default batch.rateLimit is 3 requests per 1000 ms

Delete

| Option | Description | |---------------------------------------------|--------------------------------------------------| | data.no-prompt | disable destructive action confirmation (delete) | | data.repo | name of package repository | | data.name | package name | | data.group | package group. To get packages outside of any group (scope) pass null | | data.range | package versions range to be deleted |

Download

| Option | Description | |---------------------------------------------|--------------------------------------------------| | data.cwd | cwd path for saving meta and tarballs, by default process.cwd() | | data.npmBatch.access | make meta output as @qiwi/npm-batch-cli config with blank values & given access, one of public, restricted | | data.sortField | one of version, name, group, repository | | data.sortDirection | one of asc, desc | | data.repo | name of package repository | | data.name | package name | | data.group | package group. To get packages outside of any group (scope) pass null |

Compare

| Option | Description | |---------------------------------------------|--------------------------------------------------| | data.packages[].name | name of package to compare | | data.packages[].group | group of package to compare. To get packages outside of any group (scope) pass null | | data.primaryRegistry.url | url of primary repository to compare | | data.primaryRegistry.auth.username, data.primaryRegistry.auth.password | credentials of primary repository | | data.secondaryRegistry.url | url of secondary repository to compare | | data.secondaryRegistry.auth.username, data.secondaryRegistry.auth.password | credentials of secondary repository |

All options except --no-prompt must be set through the CLI flags or --config JSON data. Options from config file can be overridden. If you want to use --no-prompt option in a config file, add it as "prompt": false.

Config file

Delete

{
    "url": "http://localhost",
    "auth": {
        "username": "foo",
        "password": "bar"
    },
    "action": "delete",
    "package": {
        "group": "qiwi",
        "name": "substrate",
        "range": ">1.2.0",
        "repo": "npm"
    }
}

Download

{
    "url": "http://localhost",
    "auth": {
        "username": "foo",
        "password": "bar"
    },
    "action": "download",
    "package": {
        "group": "qiwi",
        "name": "substrate",
        "range": ">1.2.0",
        "repo": "npm",
        "cwd": "nexus-downloads",
        "npmBatch": {
            "access": "public"
        }
    }
}

Compare

{
  "action": "compare",
  "data": {
    "cwd": "temp-compare",
    "primaryRegistry": {
      "url": "http://foo.qiwi.com:8081/repository/npm-foo",
      "auth": {
        "username": "username",
        "password": "password"
      }
    },
    "secondaryRegistry": {
      "url": "https://bar.qiwi.com/repository/npm-foo",
      "auth": {
        "username": "username",
        "password": "password"
      }
    },
    "packages": [
      {
        "name": "baz",
        "group": "qiwi-bar"
      },
      {
        "name": "foo-bar",
        "group": "qiwi"
      },
      {
        "name": "common",
        "group": "null"
      }
    ]
  }
}