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

streamline

Package Overview
Dependencies
Maintainers
0
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

streamline - npm Package Compare versions

Comparing version 0.1.14 to 0.1.15

4

examples/diskUsage.js

@@ -1,5 +0,5 @@

/*** Generated by streamline --lines-mark 0.1.12 - DO NOT EDIT ***/
/*** Generated by streamline 0.1.14 - DO NOT EDIT ***/
var __global = typeof global !== 'undefined' ? global : window;
function __cb(_, fn) { var ctx = __global.__context; return function(err, result) { __global.__context = ctx; if (err) return _(err); return fn(null, result); } }
function __cb(_, fn) { var ctx = __global.__context; return function(err, result) { __global.__context = ctx; if (err) return _(err); try { return fn(null, result); } catch (ex) { return __propagate(_, ex); } } }
function __future(fn, args, i) { var done, err, result; var cb = function(e, r) { done = true; err = e, result = r; }; args = Array.prototype.slice.call(args); args[i] = function(e, r) { cb(e, r); }; fn.apply(this, args); return function(_) { if (done) _.call(this, err, result); else cb = _.bind(this); }.bind(this); }

@@ -6,0 +6,0 @@ function __nt(_, fn) { var i = 0; var cb = __cb(_, fn); var safeCb = function() { try { cb(); } catch (ex) { __propagate(cb, ex); } }; if (typeof process != "undefined" && typeof process.nextTick == "function") return function() { if (++i % 20 == 0) process.nextTick(safeCb); else cb(); }; else return function() { if (++i % 20 == 0) setTimeout(safeCb); else cb(); }; }

@@ -23,3 +23,3 @@ /*

var fs = require('fs');
var flows = require('streamline').flows;
var flows = require('../lib/flows');

@@ -26,0 +26,0 @@ var fileFunnel = flows.funnel(20);

@@ -1,5 +0,5 @@

/*** Generated by streamline --lines-mark 0.1.12 - DO NOT EDIT ***/
/*** Generated by streamline 0.1.14 - DO NOT EDIT ***/
var __global = typeof global !== 'undefined' ? global : window;
function __cb(_, fn) { var ctx = __global.__context; return function(err, result) { __global.__context = ctx; if (err) return _(err); return fn(null, result); } }
function __cb(_, fn) { var ctx = __global.__context; return function(err, result) { __global.__context = ctx; if (err) return _(err); try { return fn(null, result); } catch (ex) { return __propagate(_, ex); } } }
function __future(fn, args, i) { var done, err, result; var cb = function(e, r) { done = true; err = e, result = r; }; args = Array.prototype.slice.call(args); args[i] = function(e, r) { cb(e, r); }; fn.apply(this, args); return function(_) { if (done) _.call(this, err, result); else cb = _.bind(this); }.bind(this); }

@@ -10,3 +10,3 @@ function __trap(err) { if (err) { if (__global.__context && __global.__context.errorHandler) __global.__context.errorHandler(err); else console.error("UNCAUGHT EXCEPTION: " + err.message + "\n" + err.stack); } }

/* 22 */ var fs = require("fs");
/* 23 */ var flows = require("streamline").flows;
/* 23 */ var flows = require("../lib/flows");
/* 25 */ var fileFunnel = flows.funnel(20);

@@ -13,0 +13,0 @@ /* 27 */ function du(_, path) {

@@ -8,4 +8,3 @@ var _demo = "\n" +

"\n info(message + ' (done!)');" +
"\n try { callback(null, message.length); }" +
"\n catch (err) { callback(err); }" +
"\n callback(null, message.length);" +
"\n }, 1000);" +

@@ -12,0 +11,0 @@ "\n}" +

"use strict";
var streamline = require('streamline');
var compile = require('./compile').compile;
var path = require('path');

@@ -70,3 +70,3 @@

case "compile":
streamline.compile(options);
compile(options);
break;

@@ -73,0 +73,0 @@ case "help":

@@ -1,62 +0,163 @@

/*** Generated by streamline --lines-preserve 0.1.12 - DO NOT EDIT ***/
"use strict"; var __global = typeof global !== 'undefined' ? global : window; function __cb(_, fn) { var ctx = __global.__context; return function(err, result) { __global.__context = ctx; if (err) return _(err); return fn(null, result); } } function __future(fn, args, i) { var done, err, result; var cb = function(e, r) { done = true; err = e, result = r; }; args = Array.prototype.slice.call(args); args[i] = function(e, r) { cb(e, r); }; fn.apply(this, args); return function(_) { if (done) _.call(this, err, result); else cb = _.bind(this); }.bind(this); } var fs = require("fs");
/*** Generated by streamline 0.1.14 - DO NOT EDIT ***/
var path = require("path");
var streamline = require("streamline");
var transform = streamline.transform;
var flows = streamline.flows;
function _exists(fname, callback) {
path.exists(fname, function __1(result) {
callback(null, result); });};
function _mkdir(dir, mode, _) { if (!_) { return __future(_mkdir, arguments, 2); }; var __then = _;
var p = path.dirname(dir); return function(__then) {
return _exists(p, __cb(_, function(__0, __1) { if (!__1) {
return _mkdir(p, mode, __cb(_, __then)); } ; return __then(); })); }(function() {
return fs.mkdir(dir, mode, __cb(_, __then)); });};
function _compile(_, input, output, options) { if (!_) { return __future(_compile, arguments, 0); }; var __then = _;
return fs.stat(input, __cb(_, function(__0, stat) {
if (stat.isDirectory()) {
output = (output || input);
return fs.readdir(input, __cb(_, function(__0, __4) { return flows.each(__cb(_, __then), __4, function __1(_, f) { if (!_) { return __future(__1, arguments, 0); } ; var __then = _;
return _compile(__cb(_, __then), path.join(input, f), path.join(output, f), options); }); })); } else {
if ((stat.isFile() && input.match(/_\.js$/))) {
output = (output || input);
if (!output.match(/\.js$/)) {
output = path.join(output, path.basename(input)); };
output = output.replace(/_\.js$/, ".js");
return fs.readFile(input, "utf8", __cb(_, function(__0, source) {
var outDir = path.dirname(output); return function(__then) {
return _exists(outDir, __cb(_, function(__0, __6) { if (!__6) {
return _mkdir(outDir, 511, __cb(_, __then)); } ; return __then(); })); }(function() {
var banner = transform.banner(options); return function(__then) { return function __1(_) { if (!_) { return __future(__1, arguments, 0); } ; var __then = _; return function __1(_) { if (!_) { return __future(__1, arguments, 0); } ; var __then = _; return function __1(_) { if (!_) { return __future(__1, arguments, 0); } ; var __then = _;
var __val = !options.force; if ((!__val == true)) { return _(null, __val); } ; return _exists(output, _); }(__cb(_, function(__0, __val) { if ((!__val == true)) { return _(null, __val); } ; return fs.stat(output, __cb(_, function(__0, __2) { return _(null, (__2.mtime >= stat.mtime)); })); })); }(__cb(_, function(__0, __val) { if ((!__val == true)) { return _(null, __val); } ;
return fs.readFile(output, "utf8", __cb(_, function(__0, __2) { return _(null, (__2.substring(0, banner.length) == banner)); })); })); }(__cb(_, function(__0, __2) { if (__2) { return _(null); } ; return __then(); })); }(function() {
if (options.verbose) {
console.log(("compiling " + input)); };
var transformed = transform.transform(source, options);
return fs.writeFile(output, (banner + transformed), "utf8", __cb(_, __then)); }); }); })); } ; return __then(); } ; }));};
exports.compile = function __1(options, _) { if (!_) { return __future(__1, arguments, 1); }; var __then = _;
options = (options || { });
if (options.verbose) {
console.log(("transform version: " + transform.version)); };
if ((options.inputs.length == 0)) {
return _(new Error("cannot compile: no files specified")) };
var cwd = process.cwd;
return flows.each(__cb(_, __then), options.inputs, function __1(_, input) { if (!_) { return __future(__1, arguments, 0); } ; var __then = _;
return _compile(__cb(_, __then), path.join(cwd, input), options.output, options); });};
"use strict";
var __global = typeof global !== 'undefined' ? global : window;
function __cb(_, fn) { var ctx = __global.__context; return function(err, result) { __global.__context = ctx; if (err) return _(err); try { return fn(null, result); } catch (ex) { return __propagate(_, ex); } } }
function __future(fn, args, i) { var done, err, result; var cb = function(e, r) { done = true; err = e, result = r; }; args = Array.prototype.slice.call(args); args[i] = function(e, r) { cb(e, r); }; fn.apply(this, args); return function(_) { if (done) _.call(this, err, result); else cb = _.bind(this); }.bind(this); }
/* 1 */ var fs = require("fs");
/* 3 */ var path = require("path");
/* 4 */ var transform = require("./transform");
/* 5 */ var flows = require("./flows");
/* 7 */ function _exists(fname, callback) {
/* 8 */ path.exists(fname, function __1(result) {
/* 9 */ callback(null, result);
});
};
/* 13 */ function _mkdir(dir, mode, _) {
if (!_) {
return __future(_mkdir, arguments, 2);
}
;
var __then = _;
/* 14 */ var p = path.dirname(dir);
return function(__then) {
/* 15 */ return _exists(p, __cb(_, function(__0, __1) {
/* 15 */ if (!__1) {
/* 16 */ return _mkdir(p, mode, __cb(_, __then));
}
;
return __then();
}));
}(function() {
/* 17 */ return fs.mkdir(dir, mode, __cb(_, __then));
});
};
/* 20 */ function _compile(_, input, output, options) {
if (!_) {
return __future(_compile, arguments, 0);
}
;
var __then = _;
/* 21 */ return fs.stat(input, __cb(_, function(__0, stat) {
/* 22 */ if (stat.isDirectory()) {
/* 23 */ output = (output || input);
/* 24 */ return fs.readdir(input, __cb(_, function(__0, __4) {
/* 24 */ return flows.each(__cb(_, __then), __4, function __1(_, f) {
if (!_) {
return __future(__1, arguments, 0);
}
;
var __then = _;
/* 25 */ return _compile(__cb(_, __then), path.join(input, f), path.join(output, f), options);
});
}));
}
else {
/* 29 */ if ((stat.isFile() && input.match(/_\.js$/))) {
/* 30 */ output = (output || input);
/* 31 */ if (!output.match(/\.js$/)) {
/* 32 */ output = path.join(output, path.basename(input));
};
/* 33 */ output = output.replace(/_\.js$/, ".js");
/* 35 */ return fs.readFile(input, "utf8", __cb(_, function(__0, source) {
/* 36 */ var outDir = path.dirname(output);
return function(__then) {
/* 37 */ return _exists(outDir, __cb(_, function(__0, __6) {
/* 37 */ if (!__6) {
/* 38 */ return _mkdir(outDir, 511, __cb(_, __then));
}
;
return __then();
}));
}(function() {
/* 39 */ var banner = transform.banner();
return function(__then) {
return function __1(_) {
if (!_) {
return __future(__1, arguments, 0);
}
;
var __then = _;
return function __1(_) {
if (!_) {
return __future(__1, arguments, 0);
}
;
var __then = _;
return function __1(_) {
if (!_) {
return __future(__1, arguments, 0);
}
;
var __then = _;
/* 40 */ var __val = !options.force;
if ((!__val == true)) {
return _(null, __val);
}
;
/* 40 */ return _exists(output, _);
}(__cb(_, function(__0, __val) {
if ((!__val == true)) {
return _(null, __val);
}
;
/* 40 */ return fs.stat(output, __cb(_, function(__0, __2) {
/* 40 */ return _(null, (__2.mtime >= stat.mtime));
}));
}));
}(__cb(_, function(__0, __val) {
if ((!__val == true)) {
return _(null, __val);
}
;
/* 41 */ return fs.readFile(output, "utf8", __cb(_, function(__0, __2) {
/* 41 */ return _(null, (__2.substring(0, banner.length) == banner));
}));
}));
}(__cb(_, function(__0, __2) {
/* 40 */ if (__2) {
return _(null);
}
;
return __then();
}));
}(function() {
/* 44 */ if (options.verbose) {
/* 45 */ console.log(("compiling " + input));
};
/* 46 */ var transformed = transform.transform(source, options);
/* 47 */ return fs.writeFile(output, (banner + transformed), "utf8", __cb(_, __then));
});
});
}));
}
;
return __then();
}
;
}));
};
/* 52 */ exports.compile = function __1(options, _) {
if (!_) {
return __future(__1, arguments, 1);
}
;
var __then = _;
/* 53 */ options = (options || {
});
/* 54 */ if (options.verbose) {
/* 55 */ console.log(("transform version: " + transform.version));
};
/* 56 */ if ((options.inputs.length == 0)) {
/* 57 */ return _(new Error("cannot compile: no files specified"))
};
/* 58 */ var cwd = process.cwd;
/* 59 */ return flows.each(__cb(_, __then), options.inputs, function __1(_, input) {
if (!_) {
return __future(__1, arguments, 0);
}
;
var __then = _;
/* 60 */ return _compile(__cb(_, __then), path.join(cwd, input), options.output, options);
});
};

@@ -1,2 +0,2 @@

/*** Generated by streamline --lines-preserve 0.1.12 - DO NOT EDIT ***/
/*** Generated by streamline 0.1.14 - DO NOT EDIT ***/
var __global = typeof global !== 'undefined' ? global : window; function __cb(_, fn) { var ctx = __global.__context; return function(err, result) { __global.__context = ctx; if (err) return _(err); return fn(null, result); } } function __future(fn, args, i) { var done, err, result; var cb = function(e, r) { done = true; err = e, result = r; }; args = Array.prototype.slice.call(args); args[i] = function(e, r) { cb(e, r); }; fn.apply(this, args); return function(_) { if (done) _.call(this, err, result); else cb = _.bind(this); }.bind(this); } function __nt(_, fn) { var i = 0; var cb = __cb(_, fn); var safeCb = function() { try { cb(); } catch (ex) { __propagate(cb, ex); } }; if (typeof process != "undefined" && typeof process.nextTick == "function") return function() { if (++i % 20 == 0) process.nextTick(safeCb); else cb(); }; else return function() { if (++i % 20 == 0) setTimeout(safeCb); else cb(); }; } function __propagate(_, err) { try { _(err); } catch (ex) { __trap(ex); } } function __trap(err) { if (err) { if (__global.__context && __global.__context.errorHandler) __global.__context.errorHandler(err); else console.error("UNCAUGHT EXCEPTION: " + err.message + "\n" + err.stack); } } function __forIn(object) { var array = []; for (var obj in object) { array.push(obj); } return array; } (function __1(exports) {

@@ -27,2 +27,4 @@

"use strict";

@@ -43,3 +45,2 @@

exports.each = function __3(_, array, fn, thisObj) { if (!_) { return __future(__3, arguments, 0); } ; var __then = _;

@@ -53,3 +54,2 @@ if ((!array || !array.length)) { return _(null) };

exports.map = function __4(_, array, fn, thisObj) { if (!_) { return __future(__4, arguments, 0); } ; var __then = _;

@@ -64,3 +64,2 @@ if (!array) {

exports.filter = function __5(_, array, fn, thisObj) { if (!_) { return __future(__5, arguments, 0); } ; var __then = _;

@@ -78,3 +77,2 @@ if (!array) {

exports.every = function __6(_, array, fn, thisObj) { if (!_) { return __future(__6, arguments, 0); } ; var __then = _;

@@ -90,3 +88,2 @@ if (!array) { return _(null) };

exports.some = function __7(_, array, fn, thisObj) { if (!_) { return __future(__7, arguments, 0); } ; var __then = _;

@@ -102,3 +99,2 @@ if (!array) { return _(null) };

exports.reduce = function __8(_, array, fn, v, thisObj) { if (!_) { return __future(__8, arguments, 0); } ; var __then = _;

@@ -113,3 +109,2 @@ if (!array) {

exports.reduceRight = function __9(_, array, fn, v, thisObj) { if (!_) { return __future(__9, arguments, 0); } ; var __then = _;

@@ -124,3 +119,2 @@ if (!array) {

exports.eachKey = function __10(_, obj, fn, thisObj) { if (!_) { return __future(__10, arguments, 0); } ; var __then = _;

@@ -138,5 +132,5 @@ if (!obj) {

exports.spray = function __11(fns, max) {
return new function __1() {
var funnel = exports.funnel(max);

@@ -209,4 +203,7 @@ this.collect = function __1(callback, count, trim) {

exports.collect = function __13(_, futures) { if (!_) { return __future(__13, arguments, 0); } ; var __then = _;
return exports.map(_, futures, function __1(_, future) { if (!_) { return __future(__1, arguments, 0); } ; var __then = _;
return future(_); }); };
})(((typeof exports !== "undefined") ? exports : (window.StreamlineFlows = (window.StreamlineFlows || {}))));

@@ -73,3 +73,3 @@ /**

var banner = transform.banner(options);
var banner = transform.banner();

@@ -76,0 +76,0 @@ function _transformIt() {

@@ -1154,3 +1154,3 @@ /**

function() {
var _functionExtraTryCatchTemplate = new Template( function _t() {
var _functionPedanticTemplate = new Template( function _t() {
{

@@ -1190,3 +1190,3 @@ if (!_) {

//node.children.splice(0, 0, _functionVarTemplate.generate(node._scope, true));
var template = node._scope.cbIndex == null ? _topLevelTemplate : (options.extraTryCatch ? _functionExtraTryCatchTemplate : _functionTemplate);
var template = node._scope.cbIndex == null ? _topLevelTemplate : (options.tryCatch === "pedantic" ? _functionPedanticTemplate : _functionTemplate);
node = template.generate(node._scope, true, {

@@ -1382,3 +1382,3 @@ fn: node._scope.name ? _identifier(node._scope.name) : _node(NULL),

function __cbExtraTryCatch(_, fn) {
function __cbSafe(_, fn) {
var ctx = __global.__context;

@@ -1408,3 +1408,3 @@ return function(err, result) {

function __cbStr(options) {
return (options && options.extraTryCatch) ? __cbExtraTryCatch.toString().replace("ExtraTryCatch", "") : __cb.toString();
return (options && options.tryCatch !== "fast") ? __cbSafe.toString().replace("Safe", "") : __cb.toString();
}

@@ -1520,5 +1520,7 @@

options = _cl(options || {}); // clone to isolate options set at file level
options.extraTryCatch |= source.indexOf("pragma streamline.extraTryCatch") >= 0;
if (source.indexOf("pragma streamline.extraTryCatch") >= 0)
options.tryCatch = "pedantic";
}
options.callback = options.callback || "_";
options.tryCatch = options.tryCatch || "safe";
options.lines = options.lines || "mark";

@@ -1582,7 +1584,7 @@ //console.log("source=" + source);

}
exports.version = "0.1.12";
exports.version = "0.1.14";
exports.banner = function(options) {
return "/*** Generated by streamline --lines-" + options.lines + " " + exports.version + " - DO NOT EDIT ***/\n";
exports.banner = function() {
return "/*** Generated by streamline " + exports.version + " - DO NOT EDIT ***/\n";
}
})(typeof exports !== 'undefined' ? exports : (window.Streamline = window.Streamline || {}));
{
"name": "streamline",
"description": "Asynchronous Javascript for dummies",
"version": "0.1.14",
"version": "0.1.15",
"engines": { "node": ">=0.2.1" },

@@ -6,0 +6,0 @@ "dependencies": {},

@@ -14,7 +14,7 @@ $(document).ready( function() {

function genTest(f1, f2, extraTryCatch) {
function genTest(f1, f2, pedantic) {
var s1 = clean(transform(f1.toString(), {
noHelpers: true,
lines: "ignore",
extraTryCatch: extraTryCatch
tryCatch: pedantic ? "pedantic" : "safe"
}));

@@ -847,6 +847,8 @@ var s2 = clean(f2.toString());

evalTest1(f, val, {
extraTryCatch: true
tryCatch: "safe"
}, function() {
delay = delaySafe;
evalTest1(f, val, null, start)
evalTest1(f, val, {
tryCatch: "fast"
}, start)
})

@@ -853,0 +855,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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