Gathering detailed insights and metrics for plugins
Gathering detailed insights and metrics for plugins
Gathering detailed insights and metrics for plugins
Gathering detailed insights and metrics for plugins
npm install plugins
Typescript
Module System
Min. Node Version
Node Version
NPM Version
71.8
Supply Chain
95.8
Quality
76.6
Maintenance
100
Vulnerability
98.9
License
JavaScript (100%)
Total Downloads
219,422
Last Day
154
Last Week
883
Last Month
5,054
Last Year
65,838
12 Stars
28 Commits
2 Forks
3 Watching
2 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
0.4.2
Package Id
plugins@0.4.2
Size
3.67 kB
NPM Version
2.10.1
Node Version
0.12.4
Cumulative downloads
Total Downloads
Last day
-12%
154
Compared to previous day
Last week
-41.6%
883
Compared to previous week
Last month
39.6%
5,054
Compared to previous month
Last year
225.2%
65,838
Compared to previous year
2
Run a value through a plugin stack.
Install with npm
1$ npm i plugins --save
See the examples.
(Table of contents generated by verb)
See the examples.
A plugin can take any arguments and must return a function.
Plugins just return a value.
Example:
1var plugins = new Plugins(); 2 3plugins 4 .use(function (str) { 5 return str + 'a'; 6 }) 7 .use(function (str) { 8 return str + 'b'; 9 }) 10 .use(function (str) { 11 return str + 'c'; 12 }); 13 14console.log(plugins.run('alphabet-')); 15//=> 'alphabet-abc'
Pass next
as the last argument to run plugins asynchronously.
Example:
1var plugins = new Plugins(); 2 3plugins 4 .use(function (str, next) { 5 next(null, str + 'a'); 6 }) 7 .use(function (str, next) { 8 next(null, str + 'b'); 9 }) 10 .use(function (str, next) { 11 next(null, str + 'c'); 12 }); 13 14plugins.run('alphabet-', function (err, str) { 15 console.log(str); //=> 'alphabet-abc' 16});
To run plugins without .use()
, pass an array of functions as a section argument to .run()
.
sync example:
1var plugins = new Plugins(); 2 3var a = function(val) { 4 return val + 'a'; 5}; 6var b = function(val) { 7 return val + 'b'; 8}; 9var c = function(val) { 10 return val + 'c'; 11}; 12 13console.log(plugins.run('alphabet-', [a, b, c])); 14//=> 'alphabet-abc'
async example:
1var plugins = new Plugins(); 2 3var a = function (str, next) { 4 next(null, str + 'a'); 5}; 6var b = function (str, next) { 7 next(null, str + 'b'); 8}; 9var c = function (str, next) { 10 next(null, str + 'c'); 11}; 12 13plugins.run('alphabet-', [a, b, c], function (err, str) { 14 console.log(str); //=> 'alphabet-abc' 15});
See the examples.
Initialize Plugins
Example
1var Plugins = require('plugins'); 2var plugins = new Plugins();
Add a plugin fn
to the plugins
stack.
Params
fn
{Function}: Plugin function to add to the plugins
stack.returns
{Object} Plugins
: to enable chaining.Example
1plugins 2 .use(foo) 3 .use(bar) 4 .use(baz)
Call each fn
in the plugins
stack to iterate over val
.
Params
val
{Array|Object|String}: The value to iterate over.Example
1plugins.run(value)
Register an iterator fn
by its type
.
Params
type
{String}: The iterator type.fn
{Function}: Iterator functionAdd each plugin to a pipeline to be used with streams. Plugins must either be a stream or a function that returns a stream.
Params
val
{Array|Object|String}: The value to iterate over.Example
1var pipeline = plugins.pipeline(plugin());
async-array-reduce: Async reduce.
Install dev dependencies:
1$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on August 14, 2015.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/28 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More