Comparing version 0.0.4 to 1.0.0
@@ -1,44 +0,30 @@ | ||
var CallbackMan = require('./callback'), | ||
LineMan = require('./line'), | ||
ParallelMan = require('./parallel'), | ||
ListMan = require('./list'), | ||
AsyncListMan = require('./async_list'), | ||
NamesMan = require('./names'); | ||
'use strict'; | ||
module.exports = { | ||
callback: function () { | ||
return new CallbackMan(); | ||
}, | ||
do: function (handler) { | ||
var self = this, | ||
m = new LineMan(); | ||
m.do(handler); | ||
return m; | ||
}, | ||
doAsync: function (handler) { | ||
var self = this, | ||
m = new ParallelMan(); | ||
m.do(handler); | ||
return m; | ||
}, | ||
for: function () { | ||
var self = this, | ||
args = Array.prototype.slice.call(arguments, 0), | ||
m = new ListMan(); | ||
m.for.apply(m, args); | ||
return m; | ||
}, | ||
forAsync: function () { | ||
var self = this, | ||
args = Array.prototype.slice.call(arguments, 0), | ||
m = new AsyncListMan(); | ||
m.for.apply(m, args); | ||
return m; | ||
}, | ||
}; | ||
var modules = [ | ||
require('./cli'), | ||
require('./code'), | ||
require('./collections'), | ||
require('./events'), | ||
require('./fs'), | ||
require('./functions'), | ||
require('./logic'), | ||
require('./math'), | ||
require('./objects'), | ||
require('./strings'), | ||
require('./templates'), | ||
require('./util') | ||
]; | ||
modules.forEach(function (mod) { | ||
extend(exports, mod); | ||
}); | ||
function extend(target, source) { | ||
Object.keys(source).forEach(function (name) { | ||
if (target[name] && typeof target[name] === 'object') { | ||
extend(target[name], source[name]); | ||
return; | ||
} | ||
target[name] = source[name]; | ||
}); | ||
} |
{ | ||
"name": "man", | ||
"version": "0.0.4", | ||
"description": "Provides a series of helper functions that allow you to perform asynchronous iteration and flow control.", | ||
"version": "1.0.0", | ||
"main": "./lib/index.js", | ||
"directories": { | ||
"test": "test" | ||
"homepage": "https://tech.sencort.com", | ||
"author": { | ||
"name": "Denis Ivanov", | ||
"email": "admin@sencort.com", | ||
"url": "https://sencort.com" | ||
}, | ||
"devDependencies": { | ||
"tap": "*" | ||
"dependencies": { | ||
"babel-core": "^6.7.2", | ||
"babel-preset-es2015": "^6.6.0", | ||
"dot": "^1.0.3", | ||
"jade": "^1.11.0", | ||
"md5": "^2.1.0", | ||
"os-tmpdir": "^1.0.1", | ||
"stylus": "^0.54.2", | ||
"uglify-js": "^2.6.2" | ||
}, | ||
"repository": "https://github.com/jf7/man.git", | ||
"keywords": [ | ||
"javascript", | ||
"flow", | ||
"callback" | ||
], | ||
"author": "jf7", | ||
"license": "BSD" | ||
"scripts": { | ||
"build": "node --use_strict --harmony ./tools/build.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git@dev.sencort.com:cort/man.git" | ||
} | ||
} |
@@ -1,94 +0,1 @@ | ||
man | ||
================================================================================ | ||
Node.js package. Provides a series of helper functions that allow you to perform asynchronous iteration and flow control. | ||
Installation | ||
-------------------------------------------------------------------------------- | ||
npm install man | ||
Callbacks aggregation | ||
-------------------------------------------------------------------------------- | ||
If you want to receive results of several callbacks at the same time, use `callback()` method: | ||
```js | ||
var fs = require('fs'), | ||
man = require('man'), | ||
cb = man.callback(); | ||
fs.readFile('file1.txt', cb.callback); | ||
fs.readFile('file2.txt', cb.callback); | ||
cb.on(function (err, content) { | ||
// On each callback. | ||
}); | ||
cb.done(function (result1, result2) { | ||
// When all callbacks have received the results. | ||
}); | ||
``` | ||
Serial execution | ||
-------------------------------------------------------------------------------- | ||
```js | ||
var man = require('man'); | ||
man.do(function () { | ||
fs.readFile('file1.txt', this.next); | ||
}).do(function (err, content) { | ||
fs.readFile('file2.txt', this.next); | ||
}).do(function (err, content) { | ||
// ... | ||
}); | ||
``` | ||
Parallel execution | ||
-------------------------------------------------------------------------------- | ||
```js | ||
var man = require('man'); | ||
man.doAsync(function () { | ||
// ... | ||
this.done(result1); | ||
}).do(function () { | ||
// ... | ||
this.done(result2); | ||
}).then(function (result1, result2) { | ||
// ... | ||
}); | ||
``` | ||
Iterations | ||
-------------------------------------------------------------------------------- | ||
### Serial iterations | ||
```js | ||
var man = require('man'); | ||
man.for([1, 2, 3, 4, 5]).do(function (number) { | ||
// On each item. | ||
this.done(number + 1); | ||
}).then(function (results) { | ||
// When all items have processed. | ||
console.log(results); // [2, 3, 4, 5, 6] | ||
}); | ||
``` | ||
### Parallel iterations | ||
```js | ||
var man = require('man'); | ||
man.forAsync([1, 2, 3, 4, 5]).do(function (number) { | ||
// On each item. | ||
this.done(number + 1); | ||
}).then(function (results) { | ||
// When all items have processed. | ||
console.log(results); // [2, 3, 4, 5, 6] | ||
}); | ||
``` | ||
# Man |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
89004
0
21
0
1781
8
2
2
10
+ Addedbabel-core@^6.7.2
+ Addedbabel-preset-es2015@^6.6.0
+ Addeddot@^1.0.3
+ Addedjade@^1.11.0
+ Addedmd5@^2.1.0
+ Addedos-tmpdir@^1.0.1
+ Addedstylus@^0.54.2
+ Addeduglify-js@^2.6.2
+ Addedacorn@1.2.22.7.0(transitive)
+ Addedacorn-globals@1.0.9(transitive)
+ Addedalign-text@0.1.4(transitive)
+ Addedamdefine@1.0.1(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedasap@1.0.0(transitive)
+ Addedatob@2.1.2(transitive)
+ Addedbabel-code-frame@6.26.0(transitive)
+ Addedbabel-core@6.26.3(transitive)
+ Addedbabel-generator@6.26.1(transitive)
+ Addedbabel-helper-call-delegate@6.24.1(transitive)
+ Addedbabel-helper-define-map@6.26.0(transitive)
+ Addedbabel-helper-function-name@6.24.1(transitive)
+ Addedbabel-helper-get-function-arity@6.24.1(transitive)
+ Addedbabel-helper-hoist-variables@6.24.1(transitive)
+ Addedbabel-helper-optimise-call-expression@6.24.1(transitive)
+ Addedbabel-helper-regex@6.26.0(transitive)
+ Addedbabel-helper-replace-supers@6.24.1(transitive)
+ Addedbabel-helpers@6.24.1(transitive)
+ Addedbabel-messages@6.23.0(transitive)
+ Addedbabel-plugin-check-es2015-constants@6.22.0(transitive)
+ Addedbabel-plugin-transform-es2015-arrow-functions@6.22.0(transitive)
+ Addedbabel-plugin-transform-es2015-block-scoped-functions@6.22.0(transitive)
+ Addedbabel-plugin-transform-es2015-block-scoping@6.26.0(transitive)
+ Addedbabel-plugin-transform-es2015-classes@6.24.1(transitive)
+ Addedbabel-plugin-transform-es2015-computed-properties@6.24.1(transitive)
+ Addedbabel-plugin-transform-es2015-destructuring@6.23.0(transitive)
+ Addedbabel-plugin-transform-es2015-duplicate-keys@6.24.1(transitive)
+ Addedbabel-plugin-transform-es2015-for-of@6.23.0(transitive)
+ Addedbabel-plugin-transform-es2015-function-name@6.24.1(transitive)
+ Addedbabel-plugin-transform-es2015-literals@6.22.0(transitive)
+ Addedbabel-plugin-transform-es2015-modules-amd@6.24.1(transitive)
+ Addedbabel-plugin-transform-es2015-modules-commonjs@6.26.2(transitive)
+ Addedbabel-plugin-transform-es2015-modules-systemjs@6.24.1(transitive)
+ Addedbabel-plugin-transform-es2015-modules-umd@6.24.1(transitive)
+ Addedbabel-plugin-transform-es2015-object-super@6.24.1(transitive)
+ Addedbabel-plugin-transform-es2015-parameters@6.24.1(transitive)
+ Addedbabel-plugin-transform-es2015-shorthand-properties@6.24.1(transitive)
+ Addedbabel-plugin-transform-es2015-spread@6.22.0(transitive)
+ Addedbabel-plugin-transform-es2015-sticky-regex@6.24.1(transitive)
+ Addedbabel-plugin-transform-es2015-template-literals@6.22.0(transitive)
+ Addedbabel-plugin-transform-es2015-typeof-symbol@6.23.0(transitive)
+ Addedbabel-plugin-transform-es2015-unicode-regex@6.24.1(transitive)
+ Addedbabel-plugin-transform-regenerator@6.26.0(transitive)
+ Addedbabel-plugin-transform-strict-mode@6.24.1(transitive)
+ Addedbabel-preset-es2015@6.24.1(transitive)
+ Addedbabel-register@6.26.0(transitive)
+ Addedbabel-runtime@6.26.0(transitive)
+ Addedbabel-template@6.26.0(transitive)
+ Addedbabel-traverse@6.26.0(transitive)
+ Addedbabel-types@6.26.0(transitive)
+ Addedbabylon@6.18.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcamelcase@1.2.1(transitive)
+ Addedcenter-align@0.1.3(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedcharacter-parser@1.2.1(transitive)
+ Addedcharenc@0.0.2(transitive)
+ Addedclean-css@3.4.28(transitive)
+ Addedcliui@2.1.0(transitive)
+ Addedcommander@2.6.02.8.1(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconstantinople@3.0.2(transitive)
+ Addedconvert-source-map@1.9.0(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addedcrypt@0.0.2(transitive)
+ Addedcss@1.0.82.2.4(transitive)
+ Addedcss-parse@1.0.42.0.0(transitive)
+ Addedcss-stringify@1.0.5(transitive)
+ Addeddebug@2.6.93.1.0(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddetect-indent@4.0.0(transitive)
+ Addeddot@1.1.3(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedglobals@9.18.0(transitive)
+ Addedgraceful-readlink@1.0.1(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedhome-or-tmp@2.0.0(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedinvariant@2.2.4(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-finite@1.1.0(transitive)
+ Addedis-promise@1.0.12.2.2(transitive)
+ Addedjade@1.11.0(transitive)
+ Addedjs-tokens@3.0.2(transitive)
+ Addedjsesc@0.5.01.3.0(transitive)
+ Addedjson5@0.5.1(transitive)
+ Addedjstransformer@0.0.2(transitive)
+ Addedkind-of@3.2.2(transitive)
+ Addedlazy-cache@1.0.4(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlongest@1.0.1(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedmd5@2.3.0(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.61.0.4(transitive)
+ Addedms@2.0.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedoptimist@0.3.7(transitive)
+ Addedos-homedir@1.0.2(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedprivate@0.1.8(transitive)
+ Addedpromise@2.0.06.1.0(transitive)
+ Addedregenerate@1.4.2(transitive)
+ Addedregenerator-runtime@0.11.1(transitive)
+ Addedregenerator-transform@0.10.1(transitive)
+ Addedregexpu-core@2.0.0(transitive)
+ Addedregjsgen@0.2.0(transitive)
+ Addedregjsparser@0.1.5(transitive)
+ Addedrepeat-string@1.6.1(transitive)
+ Addedrepeating@2.0.1(transitive)
+ Addedresolve-url@0.2.1(transitive)
+ Addedright-align@0.1.3(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsax@1.2.4(transitive)
+ Addedsemver@6.3.1(transitive)
+ Addedslash@1.0.0(transitive)
+ Addedsource-map@0.1.430.4.40.5.70.6.10.7.4(transitive)
+ Addedsource-map-resolve@0.5.3(transitive)
+ Addedsource-map-support@0.4.18(transitive)
+ Addedsource-map-url@0.4.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedstylus@0.54.8(transitive)
+ Addedsupports-color@2.0.0(transitive)
+ Addedto-fast-properties@1.0.3(transitive)
+ Addedtransformers@2.1.0(transitive)
+ Addedtrim-right@1.0.1(transitive)
+ Addeduglify-js@2.2.52.8.29(transitive)
+ Addeduglify-to-browserify@1.0.2(transitive)
+ Addedurix@0.1.0(transitive)
+ Addedvoid-elements@2.0.1(transitive)
+ Addedwindow-size@0.1.0(transitive)
+ Addedwith@4.0.3(transitive)
+ Addedwordwrap@0.0.20.0.3(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedyargs@3.10.0(transitive)