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

hexo-clean-css

Package Overview
Dependencies
Maintainers
8
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-clean-css - npm Package Compare versions

Comparing version 0.0.3 to 1.0.0

8

index.js

@@ -1,7 +0,9 @@

var assign = require('object-assign');
'use strict';
hexo.config.clean_css = assign({
/* global hexo */
hexo.config.clean_css = Object.assign({
exclude: ['*.min.css']
}, hexo.config.clean_css);
hexo.extend.filter.register('after_render:css', require('./lib/filter'));
hexo.extend.filter.register('after_render:css', require('./lib/filter'));

@@ -1,19 +0,18 @@

var CleanCSS = require('clean-css');
var minimatch = require('minimatch');
var Promise = require('bluebird');
'use strict';
module.exports = function(str, data){
var options = this.config.clean_css;
var path = data.path;
var exclude = options.exclude;
if (exclude && !Array.isArray(exclude)) exclude = [exclude];
const CleanCSS = require('clean-css');
const micromatch = require('micromatch');
const Promise = require('bluebird');
if (path && exclude && exclude.length){
for (var i = 0, len = exclude.length; i < len; i++){
if (minimatch(path, exclude[i])) return str;
}
module.exports = function(str, data) {
const options = this.config.clean_css;
const path = data.path;
const exclude = options.exclude;
if (path && exclude && exclude.length) {
if (micromatch.isMatch(path, exclude, { basename: true })) return str;
}
return new Promise(function(resolve, reject){
new CleanCSS(options).minify(str, function(err, result){
return new Promise((resolve, reject) => {
new CleanCSS(options).minify(str, (err, result) => {
if (err) return reject(err);

@@ -23,2 +22,2 @@ resolve(result.styles);

});
};
};
{
"name": "hexo-clean-css",
"version": "0.0.3",
"version": "1.0.0",
"description": "Minify CSS files with clean-css.",
"main": "index",
"main": "index.js",
"scripts": {
"test": "gulp test"
"eslint": "eslint .",
"test": "mocha test/index.js",
"test-cov": "nyc npm run test"
},
"files": [
"lib/"
],
"directories": {
"lib": "./lib"
},
"engines": {
"node": ">= 0.10.0"
},
"repository": "hexojs/hexo-clean-css",

@@ -21,25 +23,22 @@ "keywords": [

],
"author": "Tommy Chen <tommy351@gmail.com> (http://zespia.tw)",
"author": "Tommy Chen <tommy351@gmail.com> (http://zespia.tw)",
"maintainers": [
"Abner Chou <hi@abnerchou.me> (http://abnerchou.me)"
],
],
"license": "MIT",
"dependencies": {
"bluebird": "^2.9.4",
"clean-css": "^3.0.8",
"minimatch": "^3.0.1",
"object-assign": "^2.0.0"
"bluebird": "^3.5.5",
"clean-css": "^4.2.1",
"micromatch": "^4.0.2"
},
"devDependencies": {
"chai": "^1.9.1",
"coveralls": "^2.11.2",
"gulp": "^3.8.9",
"gulp-istanbul": "^0.5.0",
"gulp-jshint": "^1.8.6",
"gulp-load-plugins": "^0.8.0",
"gulp-mocha": "^2.0.0",
"jshint-stylish": "^1.0.0",
"mocha": "^2.0.1",
"rimraf": "^2.2.8"
"chai": "^4.2.0",
"eslint": "^6.1.0",
"eslint-config-hexo": "^3.0.0",
"mocha": "^6.1.4",
"nyc": "^14.1.1"
},
"engines": {
"node": ">= 8.6.0"
}
}
# hexo-clean-css
[![Build Status](https://travis-ci.org/hexojs/hexo-clean-css.svg?branch=master)](https://travis-ci.org/hexojs/hexo-clean-css)
[![NPM version](https://badge.fury.io/js/hexo-clean-css.svg)](https://www.npmjs.com/package/hexo-clean-css)

@@ -4,0 +6,0 @@ Minify CSS files with [clean-css].

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