GithubHelp home page GithubHelp logo

austinkelleher / nrd Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 3.0 40 KB

Download directly from the npm registry without using the npm CLI ๐Ÿค“

JavaScript 100.00%
npm registry download tar nrd nerd

nrd's Introduction

nrd

Download an npm registry package tar file directly. nrd is short for npm registry download. It is also for nerds. nrd is useful for easily inspecting source code of modules and creating project scaffolds. Instead of creating a repo that has a template folder inside of it and copying files over, a project can be versioned, and directly downloaded from npm into a project without dependency resolution issues. For example:

# Downloads my scaffold project from npm and renames it to `myapp`
my-cli-using-nrd create myapp

# Other examples
marko create myapp
create-react-app myapp
ember new myapp
ng new myapp

Install

npm install nrd --save

nrd also comes packaged with a command line utility enabling you to download a package from npm to any specific directory from the command line. You obviously need it. You can install nrd globally with:

npm install nrd -g

Usage:

Download a package to the current directory and decompress the tar:

const nrd = require('nrd');

nrd.download('express');

Download a package to a specific directory and decompress the tar:

const nrd = require('nrd');

nrd.download('express', {
  dir: '/Users/me/Desktop'
});

Download a specific version of a package:

const nrd = require('nrd');

nrd.download('express', {
  dir: '/Users/me/Desktop',
  version: "4.13.1"
});

Options

Available options:

const nrd = require('nrd');

nrd.download('express', {
  ...
});
  • tag {String} - A version tag to download (defaults to latest)
  • version {String} - The version to download from npm
  • dir {String} - Directory to download the file to (default to current directory)
  • untar {Boolean} - Whether the registry file should be untarred or not (defaults to true)
  • registry {String} - Change the remote npm registry to use (defaults to https://registry.npm.org).

CLI

nrd comes packaged with a fantastic command line utility. Trust me, I created it.

Download a package to the current directory and decompress the tar:

nrd express

Download a package to a specific directory and decompress the tar:

nrd express --dir /Users/me/Desktop

CLI Help / Options

Running nrd --help will give you all of the information you need!

[master] $ nrd --help
Usage: nrd [options]

Examples:

  Download an npm module to a specific directory:
     nrd express --dir /Users/me/Desktop

  Download a module from npm using a specific version:
     nrd express --version 4.14.1

  Download a module from npm using a specific tag:
     nrd express --tag beta

Options:

  --help Show this help message [string]

  --dir -d Directory to download the module into (defaults to current directory) [string]

  --tag -t A version tag to download (defaults to latest) [string]

  --version -v The version to download from npm [string]

  --untar -u Whether the registry file should be untarred or not (defaults to true) [boolean]

  --registry -r Change the remote npm registry to use (defaults to https://registry.npm.org) [string]

  --module -m * npm module name [string]

nrd's People

Contributors

austinkelleher avatar dylanpiercey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nrd's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.