Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

extract-css

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extract-css - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

.eslintrc.json

19

index.js

@@ -10,6 +10,7 @@ 'use strict';

module.exports = function (html, options, callback) {
var batch = new Batch();
var data = getStylesheetList(html, options);
batch.push(function (callback) {
getStylesData(data.html, options, callback);
var batch = new Batch(),
data = getStylesheetList(html, options);
batch.push(function (cb) {
getStylesData(data.html, options, cb);
});

@@ -20,17 +21,19 @@ if (data.hrefs.length) {

data.hrefs.forEach(function (stylesheetHref) {
batch.push(function (callback) {
getHrefContent(stylesheetHref, options.url, callback);
batch.push(function (cb) {
getHrefContent(stylesheetHref, options.url, cb);
});
});
batch.end(function (err, results) {
var stylesData = results.shift(),
css;
if (err) {
return callback(err);
}
var stylesData = results.shift();
results.forEach(function (content) {
stylesData.css.push(content);
});
var css = stylesData.css.join('\n');
css = stylesData.css.join('\n');
callback(null, stylesData.html, css);
});
};
{
"name": "extract-css",
"version": "1.0.1",
"version": "1.0.2",
"description": "Extract the CSS from an HTML document.",
"main": "index.js",
"scripts": {
"test": "gulp test"
"test": "mocha",
"coverage": "nyc npm test && nyc report",
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
},

@@ -25,13 +27,15 @@ "repository": {

"href-content": "^1.0.0",
"list-stylesheets": "^1.0.0",
"style-data": "^1.0.0"
"list-stylesheets": "^1.1.0",
"style-data": "^1.1.0"
},
"devDependencies": {
"gulp": "^3.8.10",
"gulp-jshint": "^1.9.0",
"coveralls": "^2.11.6",
"gulp": "^3.9.0",
"gulp-eslint": "^1.1.1",
"gulp-mocha": "^2.0.0",
"gulp-util": "^3.0.2",
"mocha": "^2.1.0",
"should": "^4.6.2"
"nyc": "^5.6.0",
"should": "^5.2.0"
}
}

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

# extract-css
# extract-css [![Build Status](https://travis-ci.org/jonkemp/extract-css.svg?branch=master)](https://travis-ci.org/jonkemp/extract-css) [![Coverage Status](https://coveralls.io/repos/jonkemp/extract-css/badge.svg?branch=master&service=github)](https://coveralls.io/github/jonkemp/extract-css?branch=master)
[![NPM](https://nodei.co/npm/extract-css.png?downloads=true)](https://nodei.co/npm/extract-css/)
> Extract the CSS from an HTML document.

@@ -4,0 +6,0 @@

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