Socket
Socket
Sign inDemoInstall

hyperstream

Package Overview
Dependencies
25
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.0 to 0.5.1

test/num.js

23

index.js
var trumpet = require('trumpet');
var through = require('through');
var through = require('through2');
var concat = require('concat-stream');

@@ -13,7 +13,12 @@

if (typeof value === 'object' && value.pipe) {
vstream = through().pause();
vstream = through();
value.pipe(vstream);
}
tr.selectAll(key, function (elem) {
if (/:first$/.test(key)) {
tr.select(key.replace(/:first$/,''), onmatch);
}
else tr.selectAll(key, onmatch);
function onmatch (elem) {
if (typeof value === 'string') {

@@ -24,3 +29,2 @@ elem.createWriteStream().end(value);

vstream.pipe(elem.createWriteStream());
vstream.resume();
}

@@ -38,6 +42,9 @@ else if (typeof value === 'object') {

stream.pipe(concat(function (body) {
stream.end(value(body.toString('utf8')));
stream.end(toStr(value(body.toString('utf8'))));
}));
}
});
else {
elem.createWriteStream().end(String(value));
}
}
});

@@ -48,1 +55,5 @@ return tr;

function isStream (s) { return s && typeof s.pipe === 'function' }
function toStr (s) {
if (Buffer.isBuffer(s) || typeof s === 'string') return s;
return String(s);
}
{
"name" : "hyperstream",
"version" : "0.5.0",
"description" : "stream html into html at a css selector",
"main" : "index.js",
"dependencies" : {
"trumpet" : "~1.6.3",
"duplexer" : "~0.0.2",
"through" : "~2.3.4",
"concat-stream" : "~1.0.0",
"throughout" : "~0.0.0"
},
"devDependencies" : {
"tap" : "~0.4.0",
"hyperquest" : "~0.1.5"
},
"scripts" : {
"test" : "tap test/*.js"
},
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/hyperstream.git"
},
"homepage" : "https://github.com/substack/hyperstream",
"keywords" : [
"html",
"stream",
"streaming",
"hypertext",
"template",
"engine"
],
"author" : {
"name" : "James Halliday",
"email" : "mail@substack.net",
"url" : "http://substack.net"
},
"license" : "MIT"
"name": "hyperstream",
"version": "0.5.1",
"description": "stream html into html at a css selector",
"main": "index.js",
"dependencies": {
"concat-stream": "^1.0.0",
"through2": "~0.5.1",
"trumpet": "^1.6.4"
},
"devDependencies": {
"through": "~2.3.4",
"tap": "~0.4.0",
"hyperquest": "~0.1.5"
},
"scripts": {
"test": "tap test/*.js"
},
"repository": {
"type": "git",
"url": "git://github.com/substack/hyperstream.git"
},
"homepage": "https://github.com/substack/hyperstream",
"keywords": [
"html",
"stream",
"streaming",
"hypertext",
"template",
"engine"
],
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"license": "MIT"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc