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

install-nw

v1.1.5

Published

Quickly and robustly install and cache NW.js.

Downloads

36

Readme

install-nw

Quickly and robustly install and cache NW.js.

Installs the nw module, which in turn installs NW.js. install-nw compliments nw by implementing resumable, multi-threaded downloads and archive caching.

Usage

In package.json

This module is mainly intended for usage as a caching install mechanism for other modules.

npm i --save install-nw

It installs an executable in local to a project in node_modules/.bin, since NPM sets this folder as your path during install, we can simply do this in our package.json

{
  "scripts" : { 
    "postinstall": "install-nw"
  },
  "nw": "0.12.0-1"
}

Note the addition of the nw field, this holds the version of NW.js to install.

npm arguments and environment variables

Cache
npm install --nwjs_cache=/path/to/cache
export NWJS_CACHE=/path/to/cache
npm install

This can also be added to an .npmrc file:

nwjs_cache=/path/to/cache

See CLI cache argument for details

URL Base
npm install --nwjs_urlbase=https://my.nwjs.repo/v
export NWJS_CACHE=https://my.nwjs.repo/v
npm install

This can also be added to an .npmrc file:

nwjs_urlbase=https://my.nwjs.repo/v

See CLI urlBase argument for details

CLI

It can be used as a global install too,

npm -g install install-nw
install-nw 0.12.0-1  

Not supplying a version will result in the latest NW.js version.

cache

nw-install will install to the default cache location (~/.nw-cache), to install else where (say to ~/Applications), simply pass a --cache argument.

install-nw --cache ~/Applications

urlBase

The default urlBase is as per the nw module: http://dl.nwjs.io/v

This can be changed with a --urlBase argument:

install-nw --urlBase https://my.nwjs.repo/v

Programmatic

nw-install can also be used programmatically

var install = require('nw-install');
var opts = {
  filePath: '/path/to/save/nwjs/zipfile', 
  url: ' http://dl.nwjs.io/v0.12.0-1/nwjs-v0.12.0-1-osx-x64.zip',
  version: '0.12.0-1',
  isGlobal: false
};

install(opts, function (err) {
  if (err) { 
    console.log(err.message); 
    return process.exit(err.code);
  }

  process.exit();
});

license

MIT license.

Kudos

Sponsored by nearForm