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

enb-html-freeze

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enb-html-freeze - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

lib/file.js

18

lib/freeze.js

@@ -8,4 +8,8 @@ var cheerio = require('cheerio'),

hasha = require('hasha'),
mkdirp = require('mkdirp');
mkdirp = require('mkdirp'),
File = require('./file'),
RE_ATTR_FILTER = /^(\/|[^:/]+\:)/;
exports.freeze = function(opts) {

@@ -15,2 +19,3 @@ var parser = cheerio.load(opts.html);

return _(parser(opts.tag))
.filter(_filterTag)
.chunk(opts.parallelLimit)

@@ -23,2 +28,6 @@ .map(_createCopyChunk)

function _filterTag(item) {
return !RE_ATTR_FILTER.test(item.attribs[opts.attr]);
}
function _createCopyChunk(chunk) {

@@ -39,3 +48,4 @@ return function() {

function _createStaticFile(src) {
var filePath = path.resolve(opts.nodePath, src);
var file = new File(src),
filePath = path.resolve(opts.nodePath, file.path);

@@ -51,3 +61,3 @@ return vowNode

.then(function(hash) {
return path.resolve(opts.staticDir, hash + path.extname(src));
return path.resolve(opts.staticDir, hash + file.extension);
});

@@ -60,3 +70,3 @@ }

.then(function() {
return path.relative(opts.nodePath, staticPath);
return path.relative(opts.nodePath, staticPath) + file.query;
});

@@ -63,0 +73,0 @@ }

{
"name": "enb-html-freeze",
"version": "0.1.1",
"version": "0.1.2",
"description": "Techs for freezing resoureces from HTML",

@@ -9,3 +9,3 @@ "author": "unlok <unl0k@yandex.ru>",

"bugs": "https://github.com/enb-make/enb-html-freeze/issues",
"main": "./lib/html-freeze.js",
"main": "./techs/html-freeze.js",
"licenses": [

@@ -29,2 +29,3 @@ {

"vow": "^0.4.10",
"vow-fs": "^0.3.4",
"vow-node": "^0.3.0"

@@ -31,0 +32,0 @@ },

@@ -5,4 +5,4 @@ enb-html-freeze

[![NPM version](https://img.shields.io/npm/v/enb-html-freeze.svg?style=flat)](https://www.npmjs.org/package/enb-html-freeze)
[![Build Status](https://img.shields.io/travis/enb-make/enb-html-freeze/master.svg?style=flat&label=tests)](https://travis-ci.org/enb-make/enb-html-freeze)
[![Coverage Status](https://img.shields.io/coveralls/enb-make/enb-html-freeze.svg?style=flat)](https://coveralls.io/r/enb-make/enb-html-freeze?branch=master)
[![Build Status](https://travis-ci.org/enb-make/enb-html-freeze.svg)](https://travis-ci.org/enb-make/enb-html-freeze)
[![Coverage Status](https://coveralls.io/repos/enb-make/enb-html-freeze/badge.svg?branch=feature%2Fquery-str&service=github)](https://coveralls.io/github/enb-make/enb-html-freeze?branch=feature%2Fquery-str)
[![Dependency Status](https://img.shields.io/david/enb-make/enb-html-freeze.svg?style=flat)](https://david-dm.org/enb-make/enb-html-freeze)

@@ -9,0 +9,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