New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

install-nw

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

install-nw

Quickly and robustly install and cache NW.js.

latest
Source
npmnpm
Version
1.1.5
Version published
Weekly downloads
17
112.5%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

nw

FAQs

Package last updated on 04 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts