New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hexo-filter-optimize

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-filter-optimize - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

lib/stream.js

27

lib/filter.js

@@ -6,6 +6,6 @@ // the main filter function

var Jsdom = require('jsdom').JSDOM;
var streamToArray = require('stream-to-array');
var streamToArrayAsync = Promise.promisify(streamToArray);
var streamRead = require('./stream');
var route = this.route;
var logger = this.log || console;
var root = this.config.root;

@@ -53,5 +53,8 @@ var config = this.config.filter_optimize;

var stream = route.get(path);
return streamToArrayAsync(stream)
.then(function (arr) {
inlineCssText += arr.join('');
return streamRead(stream)
.then(function (data) {
inlineCssText += data;
})
.catch(function (err) {
logger.log('Errors when get the inline css: ', path, err);
});

@@ -69,4 +72,3 @@ });

var stream = route.get(path);
return streamToArrayAsync(stream)
.then(function (arr) { return arr.join(''); })
return streamRead(stream)
.then(function (str) {

@@ -136,2 +138,5 @@ // load jsdom from the html string

// record it
if (scriptText.length > 0) {
scriptText += ';\n';
}
scriptText += el.textContent;

@@ -205,7 +210,9 @@ el.remove();

var stream = route.get(path);
return streamToArrayAsync(stream)
.then(function (arr) { return arr.join(''); })
return streamRead(stream)
.then(function (str) {
// console.log('bundle: ' + path);
content += ';\n' + str;
if (content.length > 0) {
content += ';\n';
}
content += str;
});

@@ -212,0 +219,0 @@ };

{
"name": "hexo-filter-optimize",
"version": "0.1.0",
"version": "0.1.1",
"description": "A hexo plugin that optimize the pages loading speed.",

@@ -28,4 +28,3 @@ "main": "index.js",

"jsdom": "^11.6.0",
"minimatch": "^3.0.4",
"stream-to-array": "^2.3.0"
"minimatch": "^3.0.4"
},

@@ -32,0 +31,0 @@ "devDependencies": {

@@ -33,8 +33,8 @@ # hexo-filter-optimize

# - default is ['css/main.css']
inline:
exclude:
inlines:
excludes:
js:
# bundle loaded js file into the one
bundle: true
exclude:
excludes:
```

@@ -51,2 +51,2 @@

![Comparison](https://user-images.githubusercontent.com/980449/35233293-a8229c72-ffd8-11e7-8a23-3b8bc10d40c3.png)
![Comparison](https://user-images.githubusercontent.com/980449/35233293-a8229c72-ffd8-11e7-8a23-3b8bc10d40c3.png)
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