Socket
Socket
Sign inDemoInstall

node-sass

Package Overview
Dependencies
Maintainers
6
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-sass - npm Package Compare versions

Comparing version 3.0.0-beta.7 to 3.0.0

66

lib/extensions.js

@@ -5,4 +5,3 @@ /*!

var eol = require('os').EOL,
flags = {},
var flags = {},
fs = require('fs'),

@@ -54,3 +53,3 @@ package = require('../package.json'),

* If environment variable SASS_BINARY_NAME or
* process aurgument --binary-name is provide,
* process argument --binary-name is provided,
* return it as is, otherwise make default binary

@@ -67,6 +66,6 @@ * name: {platform}-{arch}-{v8 version}.node

binaryName = flags['--sass-binary-name'];
} else if (process.env.SASS_BINARY_NAME) {
binaryName = process.env.SASS_BINARY_NAME;
} else if (package.nodeSassConfig && package.nodeSassConfig.binaryName) {
binaryName = package.nodeSassConfig.binaryName;
} else if (process.env.SASS_BINARY_NAME) {
binaryName = process.env.SASS_BINARY_NAME;
} else {

@@ -82,8 +81,25 @@ binaryName = [process.platform, '-',

/**
* Retrieve the URL to fetch binary.
* If environment variable SASS_BINARY_URL
* is set, return that path. Otherwise make
* path using current release version and
* binary name.
* Determine the URL to fetch binary file from.
* By default feth from the node-sass distribution
* site on GitHub.
*
* The default URL can be overriden using
* the environment variable SASS_BINARY_SITE
* or a command line option --sass-binary-site:
*
* node scripts/install.js --sass-binary-site http://example.com/
*
* The URL should to the mirror of the repository
* laid out as follows:
*
* SASS_BINARY_SITE/
*
* v3.0.0
* v3.0.0/freebsd-x64-14_binding.node
* ....
* v3.0.0
* v3.0.0/freebsd-ia32-11_binding.node
* v3.0.0/freebsd-x64-42_binding.node
* ... etc. for all supported versions and platforms
*
* @api private

@@ -93,22 +109,9 @@ */

function getBinaryUrl() {
return flags['--sass-binary-url'] ||
package.nodeSassConfig ? package.nodeSassConfig.binaryUrl : null ||
process.env.SASS_BINARY_URL ||
['https://github.com/sass/node-sass/releases/download/v',
package.version, '/', sass.binaryName].join('');
var site = flags['--sass-binary-site'] ||
process.env.SASS_BINARY_SITE ||
package.nodeSassConfig.binarySite;
return [site, 'v' + package.version, sass.binaryName].join('/');
}
/**
* Get Sass version information
*
* @api private
*/
function getVersionInfo() {
return [
['node-sass', package.version, '(Wrapper)', '[JavaScript]'].join('\t'),
['libsass ', package.libsass, '(Sass Compiler)', '[C/C++]'].join('\t'),
].join(eol);
}
collectArguments(process.argv.slice(2));

@@ -121,3 +124,2 @@

sass.runtime = getRuntimeInfo();
sass.versionInfo = getVersionInfo();

@@ -127,3 +129,3 @@ /**

* If environment variable SASS_BINARY_PATH or
* process aurgument --binary-path is provide,
* process argument --sass-binary-path is provided,
* select it by appending binary name, otherwise

@@ -144,6 +146,6 @@ * make default binary path using binary name.

binaryPath = flags['--sass-binary-path'];
} else if (process.env.SASS_BINARY_PATH) {
binaryPath = process.env.SASS_BINARY_PATH;
} else if (package.nodeSassConfig && package.nodeSassConfig.binaryPath) {
binaryPath = package.nodeSassConfig.binaryPath;
} else if (process.env.SASS_BINARY_PATH) {
binaryPath = process.env.SASS_BINARY_PATH;
} else {

@@ -154,3 +156,3 @@ binaryPath = path.join(__dirname, '..', 'vendor', sass.binaryName.replace(/_/, '/'));

if (!fs.existsSync(binaryPath) && throwIfNotExists) {
throw new Error('`libsass` bindings not found. Try reinstalling `node-sass`?');
throw new Error(['`libsass` bindings not found in ', binaryPath, '. Try reinstalling `node-sass`?'].join(''));
}

@@ -157,0 +159,0 @@

@@ -5,4 +5,6 @@ /*!

var path = require('path'),
util = require('util');
var eol = require('os').EOL,
path = require('path'),
util = require('util'),
package = require('../package.json');

@@ -18,2 +20,15 @@ require('./extensions');

/**
* Get Sass version information
*
* @api private
*/
function getVersionInfo(binding) {
return [
['node-sass', package.version, '(Wrapper)', '[JavaScript]'].join('\t'),
['libsass ', binding.libsassVersion(), '(Sass Compiler)', '[C/C++]'].join('\t'),
].join(eol);
}
/**
* Get input file

@@ -405,2 +420,3 @@ *

process.sass.versionInfo = getVersionInfo(binding);
module.exports.info = process.sass.versionInfo;

@@ -407,0 +423,0 @@

{
"name": "node-sass",
"version": "3.0.0-beta.7",
"libsass": "3.2.0-beta.6",
"version": "3.0.0",
"libsass": "3.2.2",
"description": "Wrapper around libsass",

@@ -21,2 +21,5 @@ "license": "MIT",

"main": "lib/index.js",
"nodeSassConfig": {
"binarySite": "https://github.com/sass/node-sass/releases/download"
},
"bin": {

@@ -56,7 +59,7 @@ "node-sass": "bin/node-sass"

"mkdirp": "^0.5.0",
"nan": "^1.7.0",
"nan": "^1.8.4",
"npmconf": "^2.1.1",
"pangyp": "^2.1.0",
"pangyp": "am11/pangyp",
"request": "^2.55.0",
"sass-graph": "^1.2.0"
"sass-graph": "^2.0.0"
},

@@ -63,0 +66,0 @@ "devDependencies": {

@@ -43,2 +43,4 @@ # node-sass

**Having installation troubles? Check out our [Troubleshooting guide](/TROUBLESHOOTING.md).**
## Usage

@@ -358,3 +360,3 @@

Both `node-sass` and `libsass` version info is now present in `package.json` and is exposed via `info` method:
Both `node-sass` and `libsass` version info is now exposed via the `info` method:

@@ -374,2 +376,4 @@ ```javascript

Since node-sass >=v3.0.0 libsass version is determined at run time.
## Integrations

@@ -376,0 +380,0 @@

@@ -101,6 +101,8 @@ /*!

function installGitDependencies(cb) {
function installGitDependencies(options, cb) {
var libsassPath = './src/libsass';
if (fs.access) { // node 0.12+, iojs 1.0.0+
if (process.env.LIBSASS_EXT || options.libsassExt) {
cb();
} else if (fs.access) { // node 0.12+, iojs 1.0.0+
fs.access(libsassPath, fs.R_OK, function(err) {

@@ -124,3 +126,3 @@ err && err.code === 'ENOENT' ? initSubmodules(cb) : cb();

function build(options) {
installGitDependencies(function(err) {
installGitDependencies(options, function(err) {
if (err) {

@@ -176,2 +178,4 @@ console.error(err.message);

options.debug = true;
} else if (arg.substring(0, 13) === '--libsass_ext' && arg.substring(14) !== 'no') {
options.libsassExt = true;
}

@@ -178,0 +182,0 @@

@@ -9,3 +9,4 @@ /*!

path = require('path'),
request = require('request');
request = require('request'),
package = require('../package.json');

@@ -24,17 +25,34 @@ require('../lib/extensions');

function download(url, dest, cb) {
var reportError = function(err) {
cb(['Cannot download "', url, '": ',
typeof err.message === 'string' ? err.message : err].join(''));
};
var successful = function(response) {
return response.statusCode >= 200 && response.statusCode < 300;
};
applyProxy({ rejectUnauthorized: false }, function(options) {
var returnError = function(err) {
cb(typeof err.message === 'string' ? err.message : err);
options.headers = {
'User-Agent': [
'node/', process.version, ' ',
'node-sass-installer/', package.version
].join('')
};
request.get(url, options).on('response', function(response) {
if (response.statusCode < 200 || response.statusCode >= 300) {
returnError(['Can not download file from:', url].join());
return;
}
response.pipe(fs.createWriteStream(dest));
cb();
}).on('error', returnError);
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));
}
});
} catch (err) {
cb(err);
}
});

@@ -41,0 +59,0 @@ }

@@ -10,3 +10,3 @@ Libsass

[![Coverage Status](https://img.shields.io/coveralls/sass/libsass.svg)](https://coveralls.io/r/sass/libsass?branch=feature%2Ftest-travis-ci-3)
[![Join us](https://still-ridge-9421.herokuapp.com/badge.svg)](https://still-ridge-9421.herokuapp.com/)
[![Join us](https://libsass-slack.herokuapp.com/badge.svg)](https://libsass-slack.herokuapp.com/)

@@ -13,0 +13,0 @@ https://github.com/sass/libsass

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

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

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

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

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

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

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

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

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