extract-css
Advanced tools
Comparing version 1.2.4 to 1.3.0
@@ -8,2 +8,14 @@ { | ||
"extends": "eslint:recommended", | ||
// Stop ESLint from looking for a configuration file in parent folders | ||
"root": true, | ||
"parser": "babel-eslint", | ||
"parserOptions": { | ||
"ecmaVersion": 8, | ||
"sourceType": "script", | ||
"ecmaFeatures": { | ||
"experimentalObjectRestSpread": true | ||
} | ||
}, | ||
"rules": { | ||
@@ -46,7 +58,2 @@ "block-scoped-var": 2, | ||
"strict": [ | ||
2, | ||
"global" | ||
], | ||
"no-shadow": 2, | ||
@@ -129,5 +136,6 @@ "no-use-before-define": 2, | ||
"new-parens": 2, | ||
"newline-after-var": [ | ||
1, | ||
"always" | ||
"padding-line-between-statements": [ | ||
"error", | ||
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*"}, | ||
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]} | ||
], | ||
@@ -137,3 +145,2 @@ "no-array-constructor": 2, | ||
"no-lonely-if": 1, | ||
"no-multi-spaces": 1, | ||
"no-multiple-empty-lines": 1, | ||
@@ -148,3 +155,2 @@ "no-new-object": 2, | ||
], | ||
"one-var": 1, | ||
"operator-assignment": [ | ||
@@ -151,0 +157,0 @@ 1, |
32
index.js
@@ -1,14 +0,12 @@ | ||
'use strict'; | ||
const assert = require('assert'); | ||
const Batch = require('batch'); | ||
const getStylesData = require('style-data'); | ||
const getStylesheetList = require('list-stylesheets'); | ||
const getHrefContent = require('href-content'); | ||
var assert = require('assert'), | ||
Batch = require('batch'), | ||
getStylesData = require('style-data'), | ||
getStylesheetList = require('list-stylesheets'), | ||
getHrefContent = require('href-content'); | ||
module.exports = (html, options, callback) => { | ||
const batch = new Batch(); | ||
const data = getStylesheetList(html, options); | ||
module.exports = function (html, options, callback) { | ||
var batch = new Batch(), | ||
data = getStylesheetList(html, options); | ||
batch.push(function (cb) { | ||
batch.push(cb => { | ||
getStylesData(data.html, options, cb); | ||
@@ -19,10 +17,10 @@ }); | ||
} | ||
data.hrefs.forEach(function (stylesheetHref) { | ||
batch.push(function (cb) { | ||
data.hrefs.forEach(stylesheetHref => { | ||
batch.push(cb => { | ||
getHrefContent(stylesheetHref, options.url, cb); | ||
}); | ||
}); | ||
batch.end(function (err, results) { | ||
var stylesData, | ||
css; | ||
batch.end((err, results) => { | ||
let stylesData; | ||
let css; | ||
@@ -35,3 +33,3 @@ if (err) { | ||
results.forEach(function (content) { | ||
results.forEach(content => { | ||
stylesData.css.push(content); | ||
@@ -38,0 +36,0 @@ }); |
{ | ||
"name": "extract-css", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"description": "Extract the CSS from an HTML document.", | ||
@@ -26,13 +26,14 @@ "main": "index.js", | ||
"batch": "^0.6.1", | ||
"href-content": "^1.0.5", | ||
"list-stylesheets": "^1.2.3", | ||
"style-data": "^1.3.2" | ||
"href-content": "^1.0.6", | ||
"list-stylesheets": "^1.2.4", | ||
"style-data": "^1.4.0" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^3.0.6", | ||
"babel-eslint": "^10.0.3", | ||
"coveralls": "^3.0.9", | ||
"gulp": "^4.0.2", | ||
"gulp-eslint": "^6.0.0", | ||
"gulp-mocha": "^7.0.2", | ||
"mocha": "^6.2.1", | ||
"nyc": "^14.1.1", | ||
"mocha": "^7.0.0", | ||
"nyc": "^15.0.0", | ||
"should": "^13.2.3", | ||
@@ -39,0 +40,0 @@ "vinyl": "^2.2.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15091
215
9
Updatedhref-content@^1.0.6
Updatedlist-stylesheets@^1.2.4
Updatedstyle-data@^1.4.0