Socket
Socket
Sign inDemoInstall

trumpet

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trumpet - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

38

index.js

@@ -15,4 +15,18 @@ var sax = require('sax');

var parser = sax.parser(false);
var stream = select(parser, opts);
var stream = select(parser, opts, write, end);
function write (buf) {
var s = buf.toString();
buffered += s;
parser.write(buf.toString());
}
function end () {
if (pos < parser.position) {
var s = buffered.slice(0, parser.position - pos);
stream.raw(s);
}
this.queue(null);
}
parser.onerror = function (err) {

@@ -22,6 +36,2 @@ stream.emit("error", err)

function write (buf) {
stream.emit('data', buf);
}
var buffered = '';

@@ -73,18 +83,2 @@ var pos = 0;

stream.write = function (buf) {
var s = buf.toString();
buffered += s;
parser.write(buf.toString());
};
stream.end = function (buf) {
if (buf !== undefined) stream.write(buf);
if (pos < parser.position) {
var s = buffered.slice(0, parser.position - pos);
stream.raw(s);
}
stream.emit('end');
};
var lastOpen;

@@ -91,0 +85,0 @@ parser.onopentag = function (tag) {

@@ -1,6 +0,6 @@

var Stream = require('stream').Stream;
var through = require('through');
var createNode = require('./node');
module.exports = function (parser, opts) {
var stream = new Stream;
module.exports = function (parser, opts, write, end) {
var stream = through(write, end);
stream.parser = parser;

@@ -7,0 +7,0 @@ stream.writable = true;

{
"name" : "trumpet",
"version" : "0.3.4",
"version" : "0.3.5",
"description" : "parse and transform streaming html using css selectors",

@@ -13,6 +13,7 @@ "main" : "index.js",

"sax" : "~0.3.5",
"ent" : "~0.0.4"
"ent" : "~0.0.4",
"through": "~2.3.4"
},
"devDependencies" : {
"tap" : "~0.2.3"
"tap" : "~0.4.0"
},

@@ -19,0 +20,0 @@ "scripts" : {

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