Socket
Socket
Sign inDemoInstall

bcrypt

Package Overview
Dependencies
Maintainers
5
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bcrypt - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

node_modules/minipass/LICENSE

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# 3.0.1 (2018-09-20)
* Update `nan` to 2.11.0
# 3.0.0 (2018-07-06)

@@ -2,0 +6,0 @@

108

node_modules/chownr/chownr.js

@@ -1,52 +0,88 @@

module.exports = chownr
chownr.sync = chownrSync
'use strict'
const fs = require('fs')
const path = require('path')
var fs = require("fs")
, path = require("path")
/* istanbul ignore next */
const LCHOWN = fs.lchown ? 'lchown' : 'chown'
/* istanbul ignore next */
const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync'
function chownr (p, uid, gid, cb) {
fs.readdir(p, function (er, children) {
// any error other than ENOTDIR means it's not readable, or
// doesn't exist. give up.
if (er && er.code !== "ENOTDIR") return cb(er)
if (er || !children.length) return fs.chown(p, uid, gid, cb)
// fs.readdir could only accept an options object as of node v6
const nodeVersion = process.version
let readdir = (path, options, cb) => fs.readdir(path, options, cb)
let readdirSync = (path, options) => fs.readdirSync(path, options)
/* istanbul ignore next */
if (/^v4\./.test(nodeVersion))
readdir = (path, options, cb) => fs.readdir(path, cb)
var len = children.length
, errState = null
children.forEach(function (child) {
var pathChild = path.resolve(p, child);
fs.lstat(pathChild, function(er, stats) {
if (er)
return cb(er)
if (!stats.isSymbolicLink())
chownr(pathChild, uid, gid, then)
else
then()
})
const chownrKid = (p, child, uid, gid, cb) => {
if (typeof child === 'string')
return fs.lstat(path.resolve(p, child), (er, stats) => {
if (er)
return cb(er)
stats.name = child
chownrKid(p, stats, uid, gid, cb)
})
function then (er) {
if (child.isDirectory()) {
chownr(path.resolve(p, child.name), uid, gid, er => {
if (er)
return cb(er)
fs[LCHOWN](path.resolve(p, child.name), uid, gid, cb)
})
} else
fs[LCHOWN](path.resolve(p, child.name), uid, gid, cb)
}
const chownr = (p, uid, gid, cb) => {
readdir(p, { withFileTypes: true }, (er, children) => {
// any error other than ENOTDIR or ENOTSUP means it's not readable,
// or doesn't exist. give up.
if (er && er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')
return cb(er)
if (er || !children.length) return fs[LCHOWN](p, uid, gid, cb)
let len = children.length
let errState = null
const then = er => {
if (errState) return
if (er) return cb(errState = er)
if (-- len === 0) return fs.chown(p, uid, gid, cb)
if (-- len === 0) return fs[LCHOWN](p, uid, gid, cb)
}
children.forEach(child => chownrKid(p, child, uid, gid, then))
})
}
function chownrSync (p, uid, gid) {
var children
const chownrKidSync = (p, child, uid, gid) => {
if (typeof child === 'string') {
const stats = fs.lstatSync(path.resolve(p, child))
stats.name = child
child = stats
}
if (child.isDirectory())
chownrSync(path.resolve(p, child.name), uid, gid)
fs[LCHOWNSYNC](path.resolve(p, child.name), uid, gid)
}
const chownrSync = (p, uid, gid) => {
let children
try {
children = fs.readdirSync(p)
children = readdirSync(p, { withFileTypes: true })
} catch (er) {
if (er && er.code === "ENOTDIR") return fs.chownSync(p, uid, gid)
if (er && er.code === 'ENOTDIR' && er.code !== 'ENOTSUP')
return fs[LCHOWNSYNC](p, uid, gid)
throw er
}
if (!children.length) return fs.chownSync(p, uid, gid)
children.forEach(function (child) {
var pathChild = path.resolve(p, child)
var stats = fs.lstatSync(pathChild)
if (!stats.isSymbolicLink())
chownrSync(pathChild, uid, gid)
})
return fs.chownSync(p, uid, gid)
if (children.length)
children.forEach(child => chownrKidSync(p, child, uid, gid))
return fs[LCHOWNSYNC](p, uid, gid)
}
module.exports = chownr
chownr.sync = chownrSync
{
"_from": "chownr@^1.0.1",
"_id": "chownr@1.0.1",
"_id": "chownr@1.1.1",
"_inBundle": false,
"_integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=",
"_integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==",
"_location": "/chownr",

@@ -21,4 +21,4 @@ "_phantomChildren": {},

],
"_resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz",
"_shasum": "e2a75042a9551908bebd25b8523d5f9769d79181",
"_resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz",
"_shasum": "54726b8b8fff4df053c42187e801fb4412df1494",
"_spec": "chownr@^1.0.1",

@@ -40,3 +40,3 @@ "_where": "/home/amitosh/Code/node.bcrypt.js/node_modules/tar",

"rimraf": "",
"tap": "^1.2.0"
"tap": "^12.0.1"
},

@@ -55,5 +55,8 @@ "files": [

"scripts": {
"test": "tap test/*.js"
"postpublish": "git push origin --all; git push origin --tags",
"postversion": "npm publish",
"preversion": "npm test",
"test": "tap test/*.js --cov"
},
"version": "1.0.1"
"version": "1.1.1"
}

@@ -0,2 +1,6 @@

# 0.4.24 / 2018-08-22
* Added MIK encoding (#196, by @Ivan-Kalatchev)
# 0.4.23 / 2018-05-07

@@ -3,0 +7,0 @@

@@ -23,6 +23,6 @@ "use strict";

this.decodeBuf = new Buffer.from(codecOptions.chars, 'ucs2');
this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2');
// Encoding buffer.
var encodeBuf = new Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));

@@ -29,0 +29,0 @@ for (var i = 0; i < codecOptions.chars.length; i++)

@@ -20,2 +20,7 @@ "use strict";

"mik": {
"type": "_sbcs",
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
// Aliases of generated encodings.

@@ -22,0 +27,0 @@ "ascii8bit": "ascii",

{
"_from": "iconv-lite@^0.4.4",
"_id": "iconv-lite@0.4.23",
"_args": [
[
"iconv-lite@0.4.24",
"/home/amitosh/Code/node.bcrypt.js"
]
],
"_from": "iconv-lite@0.4.24",
"_id": "iconv-lite@0.4.24",
"_inBundle": false,
"_integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
"_integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"_location": "/iconv-lite",
"_phantomChildren": {},
"_requested": {
"type": "range",
"type": "version",
"registry": true,
"raw": "iconv-lite@^0.4.4",
"raw": "iconv-lite@0.4.24",
"name": "iconv-lite",
"escapedName": "iconv-lite",
"rawSpec": "^0.4.4",
"rawSpec": "0.4.24",
"saveSpec": null,
"fetchSpec": "^0.4.4"
"fetchSpec": "0.4.24"
},

@@ -21,6 +27,5 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
"_shasum": "297871f63be507adcfbfca715d0cd0eed84e9a63",
"_spec": "iconv-lite@^0.4.4",
"_where": "/home/amitosh/Code/node.bcrypt.js/node_modules/needle",
"_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"_spec": "0.4.24",
"_where": "/home/amitosh/Code/node.bcrypt.js",
"author": {

@@ -37,7 +42,5 @@ "name": "Alexander Shtuchkin",

},
"bundleDependencies": false,
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3"
},
"deprecated": false,
"description": "Convert character encodings in pure javascript.",

@@ -50,3 +53,3 @@ "devDependencies": {

"mocha": "^3.1.0",
"request": "~2.81.0",
"request": "~2.87.0",
"semver": "*",

@@ -78,3 +81,3 @@ "unorm": "*"

"typings": "./lib/index.d.ts",
"version": "0.4.23"
"version": "0.4.24"
}

@@ -23,3 +23,2 @@ 'use strict'

const OBJECTMODE = Symbol('objectMode')
const SILENT_END = Symbol('silentEnd')

@@ -38,3 +37,2 @@ // Buffer in node 4.x < 4.5.0 doesn't have working Buffer.from

super()
this[SILENT_END] = false
this[FLOWING] = false

@@ -246,5 +244,5 @@ this.pipes = new Yallist()

this[RESUME]()
else if (ev === 'end' && this[SILENT_END] && this[EMITTED_END]) {
this[SILENT_END] = false
else if (ev === 'end' && this[EMITTED_END]) {
super.emit('end')
this.removeAllListeners('end')
}

@@ -312,9 +310,8 @@ }

try {
const ret = super.emit.apply(this, args)
if (ev === 'end' && ret === false)
this[SILENT_END] = true
return ret
return super.emit.apply(this, args)
} finally {
if (ev !== 'end')
this[MAYBE_EMIT_END]()
else
this.removeAllListeners('end')
}

@@ -321,0 +318,0 @@ }

{
"_from": "minipass@^2.3.3",
"_id": "minipass@2.3.3",
"_args": [
[
"minipass@2.3.4",
"/home/amitosh/Code/node.bcrypt.js"
]
],
"_from": "minipass@2.3.4",
"_id": "minipass@2.3.4",
"_inBundle": false,
"_integrity": "sha512-/jAn9/tEX4gnpyRATxgHEOV6xbcyxgT7iUnxo9Y3+OB0zX00TgKIv/2FZCf5brBbICcwbLqVv2ImjvWWrQMSYw==",
"_integrity": "sha512-mlouk1OHlaUE8Odt1drMtG1bAJA4ZA6B/ehysgV0LUIrDHdKgo1KorZq3pK0b/7Z7LJIQ12MNM6aC+Tn6lUZ5w==",
"_location": "/minipass",
"_phantomChildren": {},
"_requested": {
"type": "range",
"type": "version",
"registry": true,
"raw": "minipass@^2.3.3",
"raw": "minipass@2.3.4",
"name": "minipass",
"escapedName": "minipass",
"rawSpec": "^2.3.3",
"rawSpec": "2.3.4",
"saveSpec": null,
"fetchSpec": "^2.3.3"
"fetchSpec": "2.3.4"
},

@@ -23,6 +29,5 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.3.tgz",
"_shasum": "a7dcc8b7b833f5d368759cce544dccb55f50f233",
"_spec": "minipass@^2.3.3",
"_where": "/home/amitosh/Code/node.bcrypt.js/node_modules/tar",
"_resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.4.tgz",
"_spec": "2.3.4",
"_where": "/home/amitosh/Code/node.bcrypt.js",
"author": {

@@ -36,3 +41,2 @@ "name": "Isaac Z. Schlueter",

},
"bundleDependencies": false,
"dependencies": {

@@ -42,3 +46,2 @@ "safe-buffer": "^5.1.2",

},
"deprecated": false,
"description": "minimal implementation of a PassThrough stream",

@@ -71,3 +74,3 @@ "devDependencies": {

},
"version": "2.3.3"
"version": "2.3.4"
}

@@ -0,21 +1,23 @@

// Simple cookie handling implementation based on the standard RFC 6265.
//
// Simple cookie handling implementation based on the standard RFC 6265.
// This module just has two functionalities:
// - Parse a set-cookie-header as a key value object
// - Write a cookie-string from a key value object
//
// All cookie attributes are ignored.
//
var unescape = require('querystring').unescape;
// RegExps
const COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/;
const EXCLUDED_CHARS = /[\x00-\x1F\x7F\x3B\x3B\s\"\,\\"%]/g;
const TRAILING_SEMICOLON = /\x3B+$/;
const SEP_SEMICOLON = /\s*\x3B\s*/;
var COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/;
var EXCLUDED_CHARS = /[\x00-\x1F\x7F\x3B\x3B\s\"\,\\"%]/g;
var TRAILING_SEMICOLON = /\x3B+$/;
var SEP_SEMICOLON = /\s*\x3B\s*/;
// Constants
const KEY_INDEX = 1; // index of key from COOKIE_PAIR match
const VALUE_INDEX = 3; // index of value from COOKIE_PAIR match
// i know these should be 'const', but I'd like to keep
// supporting earlier node.js versions as long as I can. :)
var KEY_INDEX = 1; // index of key from COOKIE_PAIR match
var VALUE_INDEX = 3; // index of value from COOKIE_PAIR match
// Returns a copy str trimmed and without trainling semicolon.

@@ -22,0 +24,0 @@ function cleanCookieString(str) {

@@ -197,3 +197,5 @@ //////////////////////////////////////////

var config = {
http_opts : {}, // passed later to http.request() directly
http_opts : {
localAddress: get_option('localAddress', undefined)
}, // passed later to http.request() directly
output : options.output,

@@ -699,2 +701,7 @@ proxy : get_option('proxy', defaults.proxy),

// make sure timer is cleared if request is aborted (issue #257)
request.once('abort', function() {
if (timer) clearTimeout(timer);
})
// handle socket 'end' event to ensure we don't get delayed EPIPE errors.

@@ -701,0 +708,0 @@ request.once('socket', function(socket) {

{
"_from": "needle@^2.2.0",
"_id": "needle@2.2.1",
"_from": "needle@^2.2.1",
"_id": "needle@2.2.3",
"_inBundle": false,
"_integrity": "sha512-t/ZswCM9JTWjAdXS9VpvqhI2Ct2sL2MdY4fUXqGJaGBk13ge99ObqRksRTbBE56K+wxUXwwfZYOuZHifFW9q+Q==",
"_integrity": "sha512-GPL22d/U9cai87FcCPO6e+MT3vyHS2j+zwotakDc7kE2DtUAqFKMXLJCTtRp+5S75vXIwQPvIxkvlctxf9q4gQ==",
"_location": "/needle",

@@ -11,8 +11,8 @@ "_phantomChildren": {},

"registry": true,
"raw": "needle@^2.2.0",
"raw": "needle@^2.2.1",
"name": "needle",
"escapedName": "needle",
"rawSpec": "^2.2.0",
"rawSpec": "^2.2.1",
"saveSpec": null,
"fetchSpec": "^2.2.0"
"fetchSpec": "^2.2.1"
},

@@ -22,5 +22,5 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/needle/-/needle-2.2.1.tgz",
"_shasum": "b5e325bd3aae8c2678902fa296f729455d1d3a7d",
"_spec": "needle@^2.2.0",
"_resolved": "https://registry.npmjs.org/needle/-/needle-2.2.3.tgz",
"_shasum": "c1b04da378cd634d8befe2de965dc2cfb0fd65ca",
"_spec": "needle@^2.2.1",
"_where": "/home/amitosh/Code/node.bcrypt.js/node_modules/node-pre-gyp",

@@ -50,4 +50,4 @@ "author": {

"q": "",
"should": "",
"sinon": "",
"should": "^13.2.3",
"sinon": "^2.3.0",
"xml2js": ""

@@ -104,3 +104,3 @@ },

],
"version": "2.2.1"
"version": "2.2.3"
}

@@ -38,3 +38,3 @@ Needle

```js
needle('put', 'https://hacking.the.gibson/login', { password: 'god' })
needle('put', 'https://hacking.the.gibson/login', { password: 'god' }, { json: true })
.then(function(response) {

@@ -317,2 +317,3 @@ return doSomethingWith(response)

- `stream_length`: When sending streams, this lets you manually set the Content-Length header --if the stream's bytecount is known beforehand--, preventing ECONNRESET (socket hang up) errors on some servers that misbehave when receiving payloads of unknown size. Set it to `0` and Needle will get and set the stream's length for you, or leave unset for the default behaviour, which is no Content-Length header for stream payloads.
- `localAddress` : <string>, IP address. Passed to http/https request. Local interface from witch the request should be emitted.

@@ -319,0 +320,0 @@ Response options

@@ -42,5 +42,5 @@ var needle = require('../'),

it('error should be ENOTFOUND', function(done) {
it('error should be ENOTFOUND or EADDRINFO or EAI_AGAIN', function(done) {
needle.get(url, function(err) {
err.code.should.match(/ENOTFOUND|EADDRINFO/)
err.code.should.match(/ENOTFOUND|EADDRINFO|EAI_AGAIN/)
done();

@@ -94,3 +94,3 @@ })

it('error should be ENOTFOUND or EADDRINFO', function(done) {
it('error should be ENOTFOUND or EADDRINFO or EAI_AGAIN', function(done) {
var errorific,

@@ -105,3 +105,3 @@ stream = needle.get(url);

should.exist(errorific);
errorific.code.should.match(/ENOTFOUND|EADDRINFO/)
errorific.code.should.match(/ENOTFOUND|EADDRINFO|EAI_AGAIN/)
done();

@@ -108,0 +108,0 @@ }, 200)

@@ -41,6 +41,14 @@ var needle = require('../'),

it('fails', function(done) {
send_request(function(err){
it('does not throw', function(done) {
(function() {
send_request(function(err) {
done();
})
}).should.not.throw()
})
it('returns an error', function(done) {
send_request(function(err) {
err.should.be.an.Error;
err.code.should.eql('ENOTFOUND');
err.code.should.match(/ENOTFOUND|EADDRINFO|EAI_AGAIN/)
done();

@@ -47,0 +55,0 @@ })

# node-pre-gyp changelog
## 0.11.0
- Fixed double-install problem with node v10
- Significant N-API improvements (https://github.com/mapbox/node-pre-gyp/pull/405)
## 0.10.3
- Now will use `request` over `needle` if request is installed. By default `needle` is used for `https`. This should unbreak proxy support that regressed in v0.9.0
## 0.10.2

@@ -4,0 +13,0 @@

@@ -24,3 +24,3 @@ "use strict";

compile.run_gyp(final_args,result.opts,function(err) {
if (!err && result.opts.napi_build_version) {
if (result.opts.napi_build_version) {
napi.swap_build_dir_out(result.opts.napi_build_version);

@@ -27,0 +27,0 @@ }

@@ -22,2 +22,17 @@ "use strict";

var http_get = {
impl: undefined,
type: undefined
};
try {
http_get.impl = require('request');
http_get.type = 'request';
log.warn("Using request for node-pre-gyp https download");
} catch (e) {
http_get.impl = require('needle');
http_get.type = 'needle';
log.warn("Using needle for node-pre-gyp https download");
}
function download(uri,opts,callback) {

@@ -63,3 +78,3 @@ log.http('GET', uri);

try {
req = require('needle').get(requestOpts.uri, requestOpts);
req = http_get.impl.get(requestOpts.uri, requestOpts);
} catch (e) {

@@ -82,2 +97,3 @@ return callback(e);

var extractCount = 0;
var hasResponse = false;
var tar = require('tar');

@@ -100,2 +116,9 @@

// for request compatibility
req.on('error', function(err) {
badDownload = true;
return callback(err);
});
// for needle compatibility
req.on('err', function(err) {

@@ -107,3 +130,3 @@ badDownload = true;

req.on('close', function () {
if (extractCount === 0) {
if (!hasResponse) {
return callback(new Error('Connection closed while downloading tarball file'));

@@ -115,5 +138,6 @@ }

// ignore redirects, needle handles these automatically.
if (res.headers.hasOwnProperty('location') && res.headers.location !== '') {
return;
if (http_get.type === 'needle' && res.headers.hasOwnProperty('location') && res.headers.location !== '') {
return;
}
hasResponse = true;
if (res.statusCode !== 200) {

@@ -120,0 +144,0 @@ badDownload = true;

@@ -138,3 +138,3 @@ "use strict";

this.todo = napi.expand_commands (package_json, commands);
this.todo = napi.expand_commands (package_json, this.opts, commands);

@@ -141,0 +141,0 @@ // support for inheriting config env variables from npm

@@ -12,4 +12,4 @@ "use strict";

exports.validate = function(package_json) {
versioning.validate_config(package_json);
exports.validate = function(package_json,opts) {
versioning.validate_config(package_json,opts);
};

@@ -22,6 +22,6 @@

var package_json = require(package_json_path);
versioning.validate_config(package_json);
versioning.validate_config(package_json,opts);
var napi_build_version;
if (napi.get_napi_build_versions (package_json)) {
napi_build_version = napi.get_best_napi_build_version(package_json);
if (napi.get_napi_build_versions (package_json, opts)) {
napi_build_version = napi.get_best_napi_build_version(package_json, opts);
}

@@ -28,0 +28,0 @@ opts = opts || {};

@@ -16,3 +16,3 @@ "use strict";

];
commands = napi.expand_commands(package_json, commands);
commands = napi.expand_commands(package_json, gyp.opts, commands);
for (var i = commands.length; i !== 0; i--) {

@@ -19,0 +19,0 @@ gyp.todo.unshift(commands[i-1]);

@@ -13,3 +13,3 @@ "use strict";

var installArgs = [];
var napi_build_version = napi.get_best_napi_build_version(package_json);
var napi_build_version = napi.get_best_napi_build_version(package_json, gyp.opts);
if (napi_build_version != null) installArgs = [ napi.get_command_arg (napi_build_version) ];

@@ -16,0 +16,0 @@ gyp.todo.unshift(

@@ -1777,3 +1777,15 @@ {

"v8": "6.7"
},
"10.6.0": {
"node_abi": 64,
"v8": "6.7"
},
"10.7.0": {
"node_abi": 64,
"v8": "6.7"
},
"10.8.0": {
"node_abi": 64,
"v8": "6.7"
}
}

@@ -50,3 +50,4 @@ "use strict";

'node_abi_napi',
'napi_build_version'
'napi_build_version',
'node_napi_label'
];

@@ -65,4 +66,6 @@

node_pre_gyp_options.push('--' + key + '=' + val);
} else if (key === 'napi_build_version') {
node_pre_gyp_options.push('--' + key + '=0');
} else {
if (key !== 'napi_version' && key !== 'node_abi_napi' && key !== 'napi_build_version')
if (key !== 'napi_version' && key !== 'node_abi_napi')
return callback(new Error("Option " + key + " required but not found by node-pre-gyp"));

@@ -69,0 +72,0 @@ }

@@ -5,2 +5,3 @@ "use strict";

var rm = require('rimraf');
var log = require('npmlog');

@@ -31,4 +32,5 @@ module.exports = exports;

module.exports.get_napi_version = function() {
module.exports.get_napi_version = function(target) { // target may be undefined
// returns the non-zero numeric napi version or undefined if napi is not supported.
// correctly supporting target requires an updated cross-walk
var version = process.versions.napi; // can be undefined

@@ -42,14 +44,16 @@ if (!version) { // this code should never need to be updated

module.exports.get_napi_version_as_string = function() {
module.exports.get_napi_version_as_string = function(target) {
// returns the napi version as a string or an empty string if napi is not supported.
var version = module.exports.get_napi_version();
var version = module.exports.get_napi_version(target);
return version ? ''+version : '';
};
module.exports.validate_package_json = function(package_json) { // return err
module.exports.validate_package_json = function(package_json, opts) { // throws Error
var binary = package_json.binary;
var module_path_ok = binary.module_path && binary.module_path.indexOf('{napi_build_version}') !== -1;
var remote_path_ok = binary.remote_path && binary.remote_path.indexOf('{napi_build_version}') !== -1;
var package_name_ok = binary.package_name && binary.package_name.indexOf('{napi_build_version}') !== -1;
var napi_build_versions = module.exports.get_napi_build_versions(package_json);
var module_path_ok = pathOK(binary.module_path);
var remote_path_ok = pathOK(binary.remote_path);
var package_name_ok = pathOK(binary.package_name);
var napi_build_versions = module.exports.get_napi_build_versions(package_json,opts,true);
var napi_build_versions_raw = module.exports.get_napi_build_versions_raw(package_json);

@@ -69,3 +73,3 @@ if (napi_build_versions) {

if ((module_path_ok || remote_path_ok || package_name_ok) && !napi_build_versions) {
if ((module_path_ok || remote_path_ok || package_name_ok) && !napi_build_versions_raw) {
throw new Error("When the substitution string '{napi_build_version}` is specified in " +

@@ -75,20 +79,32 @@ "module_path, remote_path, or package_name; napi_versions must also be specified.");

if (napi_build_versions && !module.exports.get_best_napi_build_version(package_json)) {
if (napi_build_versions && !module.exports.get_best_napi_build_version(package_json, opts) &&
module.exports.build_napi_only(package_json)) {
throw new Error(
'The N-API version of this Node instance is ' + module.exports.get_napi_version() + '. ' +
'This module supports N-API version(s) ' + module.exports.get_napi_build_versions(package_json) + '. ' +
'The N-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' +
'This module supports N-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' +
'This Node instance cannot run this module.');
}
if (napi_build_versions_raw && !napi_build_versions && module.exports.build_napi_only(package_json)) {
throw new Error(
'The N-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' +
'This module supports N-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' +
'This Node instance cannot run this module.');
}
};
module.exports.expand_commands = function(package_json, commands) {
function pathOK (path) {
return path && (path.indexOf('{napi_build_version}') !== -1 || path.indexOf('{node_napi_label}') !== -1);
}
module.exports.expand_commands = function(package_json, opts, commands) {
var expanded_commands = [];
var napi_build_versions = module.exports.get_napi_build_versions(package_json);
var napi_build_versions = module.exports.get_napi_build_versions(package_json, opts);
commands.forEach(function(command){
if (napi_build_versions && command.name === 'install') {
var napi_build_version = module.exports.get_best_napi_build_version(package_json);
var napi_build_version = module.exports.get_best_napi_build_version(package_json, opts);
var args = napi_build_version ? [ napi_build_version_tag+napi_build_version ] : [ ];
expanded_commands.push ({ name: command.name, args: args });
} else if (napi_build_versions && napi_multiple_commands.includes(command.name)) {
} else if (napi_build_versions && napi_multiple_commands.indexOf(command.name) !== -1) {
napi_build_versions.forEach(function(napi_build_version){

@@ -106,12 +122,39 @@ var args = command.args.slice();

module.exports.get_napi_build_versions = function(package_json) {
module.exports.get_napi_build_versions = function(package_json, opts, warnings) { // opts may be undefined
var napi_build_versions = [];
if (package_json.binary && package_json.binary.napi_versions) { // remove duplicates
var supported_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined);
// remove duplicates, verify each napi version can actaully be built
if (package_json.binary && package_json.binary.napi_versions) {
package_json.binary.napi_versions.forEach(function(napi_version) {
if (!napi_build_versions.includes(napi_version)) napi_build_versions.push(napi_version);
var duplicated = napi_build_versions.indexOf(napi_version) !== -1;
if (!duplicated && supported_napi_version && napi_version <= supported_napi_version) {
napi_build_versions.push(napi_version);
} else if (warnings && !duplicated && supported_napi_version) {
log.info('This Node instance does not support builds for N-API version', napi_version);
}
});
}
if (opts && opts["build-latest-napi-version-only"]) {
var latest_version = 0;
napi_build_versions.forEach(function(napi_version) {
if (napi_version > latest_version) latest_version = napi_version;
});
napi_build_versions = latest_version ? [ latest_version ] : [];
}
return napi_build_versions.length ? napi_build_versions : undefined;
};
module.exports.get_napi_build_versions_raw = function(package_json) {
var napi_build_versions = [];
// remove duplicates
if (package_json.binary && package_json.binary.napi_versions) {
package_json.binary.napi_versions.forEach(function(napi_version) {
if (napi_build_versions.indexOf(napi_version) === -1) {
napi_build_versions.push(napi_version);
}
});
}
return napi_build_versions.length ? napi_build_versions : undefined;
};
module.exports.get_command_arg = function(napi_build_version) {

@@ -149,7 +192,7 @@ return napi_build_version_tag + napi_build_version;

module.exports.get_best_napi_build_version = function(package_json) {
module.exports.get_best_napi_build_version = function(package_json, opts) {
var best_napi_build_version = 0;
var napi_build_versions = module.exports.get_napi_build_versions (package_json);
var napi_build_versions = module.exports.get_napi_build_versions (package_json, opts);
if (napi_build_versions) {
var our_napi_version = module.exports.get_napi_version();
var our_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined);
napi_build_versions.forEach(function(napi_build_version){

@@ -164,1 +207,6 @@ if (napi_build_version > best_napi_build_version &&

};
module.exports.build_napi_only = function(package_json) {
return package_json.binary && package_json.binary.package_name &&
package_json.binary.package_name.indexOf('{node_napi_label}') === -1;
};

@@ -195,3 +195,3 @@ "use strict";

function validate_config(package_json) {
function validate_config(package_json,opts) {
var msg = package_json.name + ' package.json is not node-pre-gyp ready:\n';

@@ -230,3 +230,3 @@ var missing = [];

}
napi.validate_package_json(package_json);
napi.validate_package_json(package_json,opts);
}

@@ -281,3 +281,3 @@

options = options || {};
validate_config(package_json);
validate_config(package_json,options); // options is a suitable substitute for opts in this case
var v = package_json.version;

@@ -299,5 +299,6 @@ var module_version = semver.parse(v);

node_abi: get_runtime_abi(runtime,options.target),
node_abi_napi: napi.get_napi_version() ? 'napi' : get_runtime_abi(runtime,options.target),
napi_version: napi.get_napi_version(), // non-zero numeric, undefined if unsupported
napi_build_version: napi_build_version, // undefined if not specified
node_abi_napi: napi.get_napi_version(options.target) ? 'napi' : get_runtime_abi(runtime,options.target),
napi_version: napi.get_napi_version(options.target), // non-zero numeric, undefined if unsupported
napi_build_version: napi_build_version || '',
node_napi_label: napi_build_version ? 'napi-v' + napi_build_version : get_runtime_abi(runtime,options.target),
target: options.target || '',

@@ -304,0 +305,0 @@ platform: options.target_platform || process.platform,

{
"_from": "node-pre-gyp@latest",
"_id": "node-pre-gyp@0.10.2",
"_id": "node-pre-gyp@0.11.0",
"_inBundle": false,
"_integrity": "sha512-16lql9QTqs6KsB9fl3neWyZm02KxIKdI9FlJjrB0y7eMTP5Nyz+xalwPbOlw3iw7EejllJPmlJSnY711PLD1ug==",
"_integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==",
"_location": "/node-pre-gyp",

@@ -22,4 +22,4 @@ "_phantomChildren": {},

],
"_resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.2.tgz",
"_shasum": "e8945c20ef6795a20aac2b44f036eb13cf5146e3",
"_resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz",
"_shasum": "db1f33215272f692cd38f03238e3e9b47c5dd054",
"_spec": "node-pre-gyp@latest",

@@ -41,3 +41,3 @@ "_where": "/home/amitosh/Code/node.bcrypt.js",

"mkdirp": "^0.5.1",
"needle": "^2.2.0",
"needle": "^2.2.1",
"nopt": "^4.0.1",

@@ -57,3 +57,2 @@ "npm-packlist": "^1.1.6",

"nock": "^9.2.3",
"retire": "^1.2.12",
"tape": "^4.6.3"

@@ -90,3 +89,3 @@ },

},
"version": "0.10.2"
"version": "0.11.0"
}

@@ -85,3 +85,3 @@ # node-pre-gyp

- `myapp` is referenced in the package.json of a larger app and therefore `myapp` is being installed as a dependent with `npm install`.
- `myapp` is referenced in the package.json of a larger app and therefore `myapp` is being installed as a dependency with `npm install`.
- The larger app also depends on other modules installed with `node-pre-gyp`

@@ -110,3 +110,2 @@ - You only want to trigger a source compile for `myapp` and the other modules.

}
"bundledDependencies":["node-pre-gyp"],
"scripts": {

@@ -128,8 +127,6 @@ "install": "node-pre-gyp install --fallback-to-build"

- Your devDependencies should list `aws-sdk` so that you can run `node-pre-gyp publish` locally or a CI system. We recommend using `devDependencies` only since `aws-sdk` is large and not needed for `node-pre-gyp install` since it only uses http to fetch binaries
- You should add `"bundledDependencies":["node-pre-gyp"]`. This ensures that when you publish your module that the correct version of node-pre-gyp will be included in the `node_modules` folder during publishing. Then when uses install your module `node-pre-gyp` will already be present. Without this your module will not be safely installable for downstream applications that have a depedency on node-pre-gyp in the npm tree (without bundling npm deduping might break the install when node-pre-gyp is moved in flight)
- Your `scripts` section should optionally add `"prepublishOnly": "npm ls"` to ensure the right node-pre-gyp version is bundled before publishing your module. If node-pre-gyp is missing or an old version is present then this will catch that error before you publish a broken package.
- Your `scripts` section should override the `install` target with `"install": "node-pre-gyp install --fallback-to-build"`. This allows node-pre-gyp to be used instead of the default npm behavior of always source compiling with `node-gyp` directly.
- Your package.json should contain a `binary` section describing key properties you provide to allow node-pre-gyp to package optimally. They are detailed below.
Note: in the past we recommended using `"preinstall": "npm install node-pre-gyp"` as an alternative method to avoid needing to bundle. But this does not behave predictably across all npm versions - see https://github.com/mapbox/node-pre-gyp/issues/260 for the details. So we do not recommend using `preinstall` to install `node-pre-gyp`. Instead we recommend bundling. More history on this at https://github.com/strongloop/fsevents/issues/157#issuecomment-265545908.
Note: in the past we recommended putting `node-pre-gyp` in the `bundledDependencies`, but we no longer recommend this. In the past there were npm bugs (with node versions 0.10.x) that could lead to node-pre-gyp not being available at the right time during install (unless we bundled). This should no longer be the case. Also, for a time we recommended using `"preinstall": "npm install node-pre-gyp"` as an alternative method to avoid needing to bundle. But this did not behave predictably across all npm versions - see https://github.com/mapbox/node-pre-gyp/issues/260 for the details. So we do not recommend using `preinstall` to install `node-pre-gyp`. More history on this at https://github.com/strongloop/fsevents/issues/157#issuecomment-265545908.

@@ -162,3 +159,3 @@ ##### The `binary` object has three required properties

Why then not require S3? Because while some applications using node-pre-gyp need to distribute binaries as large as 20-30 MB, others might have very small binaries and might wish to store them in a GitHub repo. This is not recommended, but if an author really wants to host in a non-s3 location then it should be possible.
Why then not require S3? Because while some applications using node-pre-gyp need to distribute binaries as large as 20-30 MB, others might have very small binaries and might wish to store them in a GitHub repo. This is not recommended, but if an author really wants to host in a non-S3 location then it should be possible.

@@ -319,3 +316,3 @@ It should also be mentioned that there is an optional and entirely separate npm module called [node-pre-gyp-github](https://github.com/bchr02/node-pre-gyp-github) which is intended to complement node-pre-gyp and be installed along with it. It provides the ability to store and publish your binaries within your repositories GitHub Releases if you would rather not use S3 directly. Installation and usage instructions can be found [here](https://github.com/bchr02/node-pre-gyp-github), but the basic premise is that instead of using the ```node-pre-gyp publish``` command you would use ```node-pre-gyp-github publish```.

For each of the N-API module operations `node-pre-gyp` initiates, it insures that the `napi_build_version` is set appropriately.
For each of the N-API module operations `node-pre-gyp` initiates, it ensures that the `napi_build_version` is set appropriately.

@@ -327,3 +324,3 @@ This value is of importance in two areas:

### Defining `NAPI_BUILD_VERSION` for the C/C++ code
### Defining `NAPI_VERSION` for the C/C++ code

@@ -334,8 +331,10 @@ The `napi_build_version` value is communicated to the C/C++ code by adding this code to the `binding.gyp` file:

"defines": [
"NAPI_BUILD_VERSION=<(napi_build_version)",
"NAPI_VERSION=<(napi_build_version)",
]
```
This insures that `NAPI_BUILD_VERSION`, an integer value, is declared appropriately to the C/C++ code for each build.
This ensures that `NAPI_VERSION`, an integer value, is declared appropriately to the C/C++ code for each build.
> Note that earlier versions of this document recommended defining the symbol `NAPI_BUILD_VERSION`. `NAPI_VERSION` is prefered because it used by the N-API C/C++ headers to configure the specific N-API veriosn being requested.
### Path and file naming requirements in `package.json`

@@ -345,3 +344,3 @@

Specifically, when performing N-API builds, the `{napi_build_version}` text substitution string *must* be present in the `module_path` property. In addition, the `{napi_build_version}` text substitution string *must* be present in either the `remote_path` or `package_name` property. (No problem if it's in both.)
Specifically, when performing N-API builds, the `{napi_build_version}` text configuration value *must* be present in the `module_path` property. In addition, the `{napi_build_version}` text configuration value *must* be present in either the `remote_path` or `package_name` property. (No problem if it's in both.)

@@ -361,5 +360,38 @@ Here's an example:

## Supporting both N-API and NAN builds
You may have a legacy native add-on that you wish to continue supporting for those versions of Node that do not support N-API, as you add N-API support for later Node versions. This can be accomplished by specifying the `node_napi_label` configuration value in the package.json `binary.package_name` property.
Placing the configuration value `node_napi_label` in the package.json `binary.package_name` property instructs `node-pre-gyp` to build all viable N-API binaries supported by the current Node instance. If the current Node instance does not support N-API, `node-pre-gyp` will request a traditional, non-N-API build.
The configuration value `node_napi_label` is set by `node-pre-gyp` to the type of build created, `napi` or `node`, and the version number. For N-API builds, the string contains the N-API version nad has values like `napi-v3`. For traditional, non-N-API builds, the string contains the ABI version with values like `node-v46`.
Here's how the `binary` configuration above might be changed to support both N-API and NAN builds:
```js
"binary": {
"module_name": "your_module",
"module_path": "./lib/binding/{node_napi_label}",
"remote_path": "./{module_name}/v{version}/{configuration}/",
"package_name": "{platform}-{arch}-{node_napi_label}.tar.gz",
"host": "https://your_bucket.s3-us-west-1.amazonaws.com",
"napi_versions": [1,3]
}
```
The C/C++ symbol `NAPI_VERSION` can be used to distinguish N-API and non-N-API builds. The value of `NAPI_VERSION` is set to the integer N-API version for N-API builds and is set to `0` for non-N-API builds.
For example:
```C
#if NAPI_VERSION
// N-API code goes here
#else
// NAN code goes here
#endif
```
### Two additional configuration values
For those who need them in legacy projects, two additional configuration values are available for all builds.
The following two configuration values, which were implemented in previous versions of `node-pre-gyp`, continue to exist, but have been replaced by the `node_napi_label` configuration value described above.

@@ -366,0 +398,0 @@ 1. `napi_version` If N-API is supported by the currently executing Node instance, this value is the N-API version number supported by Node. If N-API is not supported, this value is an empty string.

@@ -38,2 +38,3 @@ 'use strict'

this.seen = new Set()
this.didDone = false

@@ -118,3 +119,4 @@ this.children = 0

childDep (dep) {
if (this.node_modules.indexOf(dep) !== -1) {
if (this.node_modules.indexOf(dep) !== -1 && !this.seen.has(dep)) {
this.seen.add(dep)
this.child(dep)

@@ -121,0 +123,0 @@ } else if (this.parent) {

{
"_from": "npm-bundled@^1.0.1",
"_id": "npm-bundled@1.0.3",
"_args": [
[
"npm-bundled@1.0.5",
"/home/amitosh/Code/node.bcrypt.js"
]
],
"_from": "npm-bundled@1.0.5",
"_id": "npm-bundled@1.0.5",
"_inBundle": false,
"_integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==",
"_integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==",
"_location": "/npm-bundled",
"_phantomChildren": {},
"_requested": {
"type": "range",
"type": "version",
"registry": true,
"raw": "npm-bundled@^1.0.1",
"raw": "npm-bundled@1.0.5",
"name": "npm-bundled",
"escapedName": "npm-bundled",
"rawSpec": "^1.0.1",
"rawSpec": "1.0.5",
"saveSpec": null,
"fetchSpec": "^1.0.1"
"fetchSpec": "1.0.5"
},

@@ -21,6 +27,5 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.3.tgz",
"_shasum": "7e71703d973af3370a9591bafe3a63aca0be2308",
"_spec": "npm-bundled@^1.0.1",
"_where": "/home/amitosh/Code/node.bcrypt.js/node_modules/npm-packlist",
"_resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz",
"_spec": "1.0.5",
"_where": "/home/amitosh/Code/node.bcrypt.js",
"author": {

@@ -34,4 +39,2 @@ "name": "Isaac Z. Schlueter",

},
"bundleDependencies": false,
"deprecated": false,
"description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof",

@@ -42,3 +45,3 @@ "devDependencies": {

"rimraf": "^2.6.1",
"tap": "^10.3.2"
"tap": "^12.0.1"
},

@@ -62,3 +65,3 @@ "files": [

},
"version": "1.0.3"
"version": "1.0.5"
}

@@ -7,2 +7,4 @@ # npm-bundled

[![Build Status](https://travis-ci.org/npm/npm-bundled.svg?branch=master)](https://travis-ci.org/npm/npm-bundled)
## USAGE

@@ -9,0 +11,0 @@

{
"_from": "npm-packlist@^1.1.6",
"_id": "npm-packlist@1.1.10",
"_args": [
[
"npm-packlist@1.1.11",
"/home/amitosh/Code/node.bcrypt.js"
]
],
"_from": "npm-packlist@1.1.11",
"_id": "npm-packlist@1.1.11",
"_inBundle": false,
"_integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==",
"_integrity": "sha512-CxKlZ24urLkJk+9kCm48RTQ7L4hsmgSVzEk0TLGPzzyuFxD7VNgy5Sl24tOLMzQv773a/NeJ1ce1DKeacqffEA==",
"_location": "/npm-packlist",
"_phantomChildren": {},
"_requested": {
"type": "range",
"type": "version",
"registry": true,
"raw": "npm-packlist@^1.1.6",
"raw": "npm-packlist@1.1.11",
"name": "npm-packlist",
"escapedName": "npm-packlist",
"rawSpec": "^1.1.6",
"rawSpec": "1.1.11",
"saveSpec": null,
"fetchSpec": "^1.1.6"
"fetchSpec": "1.1.11"
},

@@ -21,6 +27,5 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.10.tgz",
"_shasum": "1039db9e985727e464df066f4cf0ab6ef85c398a",
"_spec": "npm-packlist@^1.1.6",
"_where": "/home/amitosh/Code/node.bcrypt.js/node_modules/node-pre-gyp",
"_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.11.tgz",
"_spec": "1.1.11",
"_where": "/home/amitosh/Code/node.bcrypt.js",
"author": {

@@ -34,3 +39,2 @@ "name": "Isaac Z. Schlueter",

},
"bundleDependencies": false,
"dependencies": {

@@ -40,3 +44,2 @@ "ignore-walk": "^3.0.1",

},
"deprecated": false,
"description": "Get a list of the files to add from a folder into an npm package",

@@ -46,3 +49,3 @@ "devDependencies": {

"rimraf": "^2.6.1",
"tap": "^10.7.2"
"tap": "^12.0.1"
},

@@ -69,3 +72,3 @@ "directories": {

},
"version": "1.1.10"
"version": "1.1.11"
}
{
"_from": "semver@^5.3.0",
"_id": "semver@5.5.0",
"_args": [
[
"semver@5.5.1",
"/home/amitosh/Code/node.bcrypt.js"
]
],
"_from": "semver@5.5.1",
"_id": "semver@5.5.1",
"_inBundle": false,
"_integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
"_integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==",
"_location": "/semver",
"_phantomChildren": {},
"_requested": {
"type": "range",
"type": "version",
"registry": true,
"raw": "semver@^5.3.0",
"raw": "semver@5.5.1",
"name": "semver",
"escapedName": "semver",
"rawSpec": "^5.3.0",
"rawSpec": "5.5.1",
"saveSpec": null,
"fetchSpec": "^5.3.0"
"fetchSpec": "5.5.1"
},

@@ -21,6 +27,5 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
"_shasum": "dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab",
"_spec": "semver@^5.3.0",
"_where": "/home/amitosh/Code/node.bcrypt.js/node_modules/node-pre-gyp",
"_resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz",
"_spec": "5.5.1",
"_where": "/home/amitosh/Code/node.bcrypt.js",
"bin": {

@@ -32,7 +37,5 @@ "semver": "./bin/semver"

},
"bundleDependencies": false,
"deprecated": false,
"description": "The semantic version parser used by npm.",
"devDependencies": {
"tap": "^10.7.0"
"tap": "^12.0.1"
},

@@ -55,3 +58,3 @@ "files": [

},
"version": "5.5.0"
"version": "5.5.1"
}

@@ -277,3 +277,3 @@ semver(1) -- The semantic versioner for npm

simple ::= primitive | partial | tilde | caret
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?

@@ -280,0 +280,0 @@ xr ::= 'x' | 'X' | '*' | nr

@@ -12,6 +12,7 @@ 'use strict'

const SLURP = Symbol('slurp')
const TYPE = Symbol('type')
class Header {
constructor (data, off) {
constructor (data, off, ex, gex) {
this.cksumValid = false

@@ -39,3 +40,3 @@ this.needPax = false

if (Buffer.isBuffer(data))
this.decode(data, off || 0)
this.decode(data, off || 0, ex, gex)
else if (data)

@@ -45,3 +46,3 @@ this.set(data)

decode (buf, off) {
decode (buf, off, ex, gex) {
if (!off)

@@ -61,2 +62,7 @@ off = 0

// if we have extended or global extended headers, apply them now
// See https://github.com/npm/node-tar/pull/187
this[SLURP](ex)
this[SLURP](gex, true)
// old tar versions marked dirs as a file with a trailing /

@@ -108,2 +114,12 @@ this[TYPE] = decString(buf, off + 156, 1)

[SLURP] (ex, global) {
for (let k in ex) {
// we slurp in everything except for the path attribute in
// a global extended header, because that's weird.
if (ex[k] !== null && ex[k] !== undefined &&
!(global && k === 'path'))
this[k] = ex[k]
}
}
encode (buf, off) {

@@ -110,0 +126,0 @@ if (!buf) {

@@ -104,3 +104,3 @@ 'use strict'

[CONSUMEHEADER] (chunk, position) {
const header = new Header(chunk, position)
const header = new Header(chunk, position, this[EX], this[GEX])

@@ -107,0 +107,0 @@ if (header.nullBlock)

@@ -334,4 +334,6 @@ 'use strict'

const tx = this.transform ? this.transform(entry) || entry : entry
if (tx !== entry)
if (tx !== entry) {
tx.on('error', er => this[ONERROR](er, entry))
entry.pipe(tx)
}
tx.pipe(stream)

@@ -516,4 +518,6 @@ }

const tx = this.transform ? this.transform(entry) || entry : entry
if (tx !== entry)
if (tx !== entry) {
tx.on('error', er => this[ONERROR](er, entry))
entry.pipe(tx)
}

@@ -520,0 +524,0 @@ tx.on('data', chunk => {

{
"_from": "tar@^4",
"_id": "tar@4.4.4",
"_args": [
[
"tar@4.4.6",
"/home/amitosh/Code/node.bcrypt.js"
]
],
"_from": "tar@4.4.6",
"_id": "tar@4.4.6",
"_inBundle": false,
"_integrity": "sha512-mq9ixIYfNF9SK0IS/h2HKMu8Q2iaCuhDDsZhdEag/FHv8fOaYld4vN7ouMgcSSt5WKZzPs8atclTcJm36OTh4w==",
"_integrity": "sha512-tMkTnh9EdzxyfW+6GK6fCahagXsnYk6kE6S9Gr9pjVdys769+laCTbodXDhPAjzVtEBazRgP0gYqOjnk9dQzLg==",
"_location": "/tar",
"_phantomChildren": {},
"_requested": {
"type": "range",
"type": "version",
"registry": true,
"raw": "tar@^4",
"raw": "tar@4.4.6",
"name": "tar",
"escapedName": "tar",
"rawSpec": "^4",
"rawSpec": "4.4.6",
"saveSpec": null,
"fetchSpec": "^4"
"fetchSpec": "4.4.6"
},

@@ -21,6 +27,5 @@ "_requiredBy": [

],
"_resolved": "https://registry.npmjs.org/tar/-/tar-4.4.4.tgz",
"_shasum": "ec8409fae9f665a4355cc3b4087d0820232bb8cd",
"_spec": "tar@^4",
"_where": "/home/amitosh/Code/node.bcrypt.js/node_modules/node-pre-gyp",
"_resolved": "https://registry.npmjs.org/tar/-/tar-4.4.6.tgz",
"_spec": "4.4.6",
"_where": "/home/amitosh/Code/node.bcrypt.js",
"author": {

@@ -34,3 +39,2 @@ "name": "Isaac Z. Schlueter",

},
"bundleDependencies": false,
"dependencies": {

@@ -45,3 +49,2 @@ "chownr": "^1.0.1",

},
"deprecated": false,
"description": "tar for node",

@@ -80,3 +83,3 @@ "devDependencies": {

},
"version": "4.4.4"
"version": "4.4.6"
}

@@ -233,3 +233,6 @@ # node-tar

[Alias: `m`, `no-mtime`]
- `mtime` Set to a `Date` object to force a specific `mtime` for
everything added to the archive. Overridden by `noMtime`.
The following options are mostly internal, but can be modified in some

@@ -236,0 +239,0 @@ advanced use cases, such as re-using caches between runs.

@@ -14,3 +14,3 @@ {

"main": "./bcrypt",
"version": "3.0.0",
"version": "3.0.1",
"author": "Nick Campbell (https://github.com/ncb000gt)",

@@ -33,7 +33,7 @@ "engines": {

"dependencies": {
"nan": "2.10.0",
"node-pre-gyp": "0.10.2"
"nan": "2.11.0",
"node-pre-gyp": "0.11.0"
},
"devDependencies": {
"nodeunit": "^0.11.2"
"nodeunit": "^0.11.3"
},

@@ -64,6 +64,6 @@ "bundledDependencies": [

"module_path": "./lib/binding/",
"host": "https://github.com",
"remote_path": "/kelektiv/node.bcrypt.js/releases/download/v{version}/",
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}-{libc}.tar.gz"
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}-{libc}.tar.gz",
"host": "https://github.com/kelektiv/node.bcrypt.js/releases/download/",
"remote_path": "v{version}"
}
}

@@ -19,12 +19,10 @@ # node.bcrypt.js

| Node Version | Bcrypt Version |
| ---- | ---- |
| 0.4.x | <= 0.4.x |
| 0.6.x | >= 0.5.x |
| 0.8.x | >= 0.5.x |
| 0.10.x | >= 0.5.x |
| 0.11.x | >= 0.8.x |
| 4.x.x | <= 2.0.x |
| 8.x.x | >= 1.0.3 |
| 10.x.x | >= 3.0.0 |
| Node Version | Bcrypt Version |
| -------------- | -------------- |
| 0.4 | <= 0.4 |
| 0.6, 0.8, 0.10 | >= 0.5 |
| 0.11 | >= 0.8 |
| 4 | < 2.1 |
| 8 | >= 1.0.3 |
| 10 | >= 3 |

@@ -98,3 +96,3 @@ `node-gyp` only works with stable/released versions of node. Since the `bcrypt` module uses `node-gyp` to build and install you'll need a stable version of node to use bcrypt. If you do not you'll likely see an error that starts with:

```javascript
var bcrypt = require('bcrypt');
const bcrypt = require('bcrypt');
const saltRounds = 10;

@@ -183,3 +181,3 @@ const myPlaintextPassword = 's0/\/\P4$$w0rD';

```javascript
var bcrypt = require('bcrypt');
const bcrypt = require('bcrypt');
const saltRounds = 10;

@@ -221,5 +219,4 @@ const myPlaintextPassword = 's0/\/\P4$$w0rD';

### Why is async mode recommended over sync mode?
If you are using bcrypt on a simple script, using the sync mode is perfectly fine. However, if you are using bcrypt on a server, the async mode is recommended. This is because the hashing done by bcrypt is CPU intensive, so the sync version will block the event loop and prevent your application from servicing any other inbound requests or events. The async version uses a thread pool which does not block the main event loop.
If you are using bcrypt on a simple script, using the sync mode is perfectly fine. However, if you are using bcrypt on a server, the async mode is recommended. This is because the hashing done by bcrypt is CPU intensive, so the sync version will block the event loop and prevent your application from servicing any other inbound requests or events.
## API

@@ -226,0 +223,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc