node-sass
Advanced tools
Comparing version 3.6.0 to 3.7.0
@@ -5,3 +5,4 @@ /*! | ||
var sass = require('./extensions'); | ||
var sass = require('./extensions'), | ||
pkg = require('../package.json'); | ||
@@ -36,3 +37,3 @@ function humanEnvironment() { | ||
'For more information on which environments are supported please see:', | ||
'TODO URL' | ||
'https://github.com/sass/node-sass/releases/tag/v' + pkg.version | ||
].join('\n'); | ||
@@ -39,0 +40,0 @@ }; |
@@ -40,2 +40,3 @@ /*! | ||
case 47: return 'Node.js 5.x'; | ||
case 48: return 'Node.js 6.x'; | ||
default: return false; | ||
@@ -46,13 +47,26 @@ } | ||
function getHumanEnvironment(env) { | ||
var parts = env.replace(/_binding\.node$/, '').split('-'); | ||
var binding = env.replace(/_binding\.node$/, ''), | ||
parts = binding.split('-'), | ||
platform = getHumanPlatform(parts[0]), | ||
arch = getHumanArchitecture(parts[1]), | ||
runtime = getHumanNodeVersion(parts[2]); | ||
if (parts.length !== 3) { | ||
return 'Unknown environment'; | ||
return 'Unknown environment (' + binding + ')'; | ||
} | ||
if (!platform) { | ||
platform = 'Unsupported platform (' + parts[0] + ')'; | ||
} | ||
if (!arch) { | ||
arch = 'Unsupported architecture (' + parts[1] + ')'; | ||
} | ||
if (!runtime) { | ||
runtime = 'Unsupported runtime (' + parts[2] + ')'; | ||
} | ||
return [ | ||
getHumanPlatform(parts[0]), | ||
getHumanArchitecture(parts[1]), | ||
'with', | ||
getHumanNodeVersion(parts[2]), | ||
platform, arch, 'with', runtime, | ||
].join(' '); | ||
@@ -65,7 +79,7 @@ } | ||
function isSupportedEnvironment() { | ||
function isSupportedEnvironment(platform, arch, runtime) { | ||
return ( | ||
false !== getHumanPlatform() && | ||
false !== getHumanArchitecture() && | ||
false !== getHumanNodeVersion() | ||
false !== getHumanPlatform(platform) && | ||
false !== getHumanArchitecture(arch) && | ||
false !== getHumanNodeVersion(runtime) | ||
); | ||
@@ -72,0 +86,0 @@ } |
{ | ||
"name": "node-sass", | ||
"version": "3.6.0", | ||
"version": "3.7.0", | ||
"libsass": "3.3.6", | ||
@@ -64,5 +64,4 @@ "description": "Wrapper around libsass", | ||
"mkdirp": "^0.5.1", | ||
"nan": "^2.2.0", | ||
"nan": "^2.3.2", | ||
"node-gyp": "^3.3.1", | ||
"npmconf": "^2.1.2", | ||
"request": "^2.61.0", | ||
@@ -69,0 +68,0 @@ "sass-graph": "^2.1.1" |
# node-sass | ||
#### Supported Node.js versions 0.10, 0.12, 1, 2, 3, 4, and 5. | ||
<table> | ||
@@ -4,0 +6,0 @@ <tr> |
@@ -8,3 +8,2 @@ /*! | ||
mkdir = require('mkdirp'), | ||
npmconf = require('npmconf'), | ||
path = require('path'), | ||
@@ -34,2 +33,3 @@ sass = require('../lib/extensions'), | ||
}; | ||
var successful = function(response) { | ||
@@ -39,32 +39,45 @@ return response.statusCode >= 200 && response.statusCode < 300; | ||
applyProxy({ rejectUnauthorized: false }, function(options) { | ||
options.headers = { | ||
'User-Agent': [ | ||
'node/', process.version, ' ', | ||
'node-sass-installer/', pkg.version | ||
].join('') | ||
}; | ||
try { | ||
request(url, options, function(err, response) { | ||
if (err) { | ||
reportError(err); | ||
} else if (!successful(response)) { | ||
reportError(['HTTP error', response.statusCode, response.statusMessage].join(' ')); | ||
} else { | ||
cb(); | ||
var options = { | ||
rejectUnauthorized: false, | ||
proxy: getProxy(), | ||
headers: { | ||
'User-Agent': getUserAgent(), | ||
} | ||
}; | ||
try { | ||
request(url, options, function(err, response) { | ||
if (err) { | ||
reportError(err); | ||
} else if (!successful(response)) { | ||
reportError(['HTTP error', response.statusCode, response.statusMessage].join(' ')); | ||
} else { | ||
cb(); | ||
} | ||
}) | ||
.on('response', function(response) { | ||
if (successful(response)) { | ||
response.pipe(fs.createWriteStream(dest)); | ||
} | ||
}).on('response', function(response) { | ||
if (successful(response)) { | ||
response.pipe(fs.createWriteStream(dest)); | ||
} | ||
}); | ||
} catch (err) { | ||
cb(err); | ||
} | ||
}); | ||
}); | ||
} catch (err) { | ||
cb(err); | ||
} | ||
} | ||
/** | ||
* Get applyProxy settings | ||
* A custom user agent use for binary downloads. | ||
* | ||
* @api private | ||
*/ | ||
function getUserAgent() { | ||
return [ | ||
'node/', process.version, ' ', | ||
'node-sass-installer/', pkg.version | ||
].join(''); | ||
} | ||
/** | ||
* Determine local proxy settings | ||
* | ||
* @param {Object} options | ||
@@ -75,22 +88,10 @@ * @param {Function} cb | ||
function applyProxy(options, cb) { | ||
npmconf.load({}, function (er, conf) { | ||
var proxyUrl; | ||
if (!er) { | ||
proxyUrl = conf.get('https-proxy') || | ||
conf.get('proxy') || | ||
conf.get('http-proxy'); | ||
} | ||
var env = process.env; | ||
options.proxy = proxyUrl || | ||
env.HTTPS_PROXY || | ||
env.https_proxy || | ||
env.HTTP_PROXY || | ||
env.http_proxy; | ||
cb(options); | ||
}); | ||
function getProxy() { | ||
return process.env.npm_config_https_proxy || | ||
process.env.npm_config_proxy || | ||
process.env.npm_config_http_proxy || | ||
process.env.HTTPS_PROXY || | ||
process.env.https_proxy || | ||
process.env.HTTP_PROXY || | ||
process.env.http_proxy; | ||
} | ||
@@ -136,5 +137,5 @@ | ||
/** | ||
* If binary does not exsit, download it | ||
* If binary does not exist, download it | ||
*/ | ||
checkAndDownloadBinary(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 7 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1509203
13
1110
576
30
- Removednpmconf@^2.1.2
- Removedconfig-chain@1.1.13(transitive)
- Removedini@1.3.8(transitive)
- Removednpmconf@2.1.3(transitive)
- Removedonce@1.3.3(transitive)
- Removedproto-list@1.2.4(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsemver@4.3.6(transitive)
- Removeduid-number@0.0.5(transitive)
Updatednan@^2.3.2