Gathering detailed insights and metrics for p
Gathering detailed insights and metrics for p
Gathering detailed insights and metrics for p
Gathering detailed insights and metrics for p
npm install p
Typescript
Module System
Min. Node Version
Node Version
NPM Version
72.2
Supply Chain
98.8
Quality
75.3
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
133,592
Last Day
53
Last Week
356
Last Month
1,742
Last Year
26,609
38 Stars
32 Commits
5 Forks
3 Watchers
1 Branches
2 Contributors
Updated on May 25, 2023
Minified
Minified + Gzipped
Latest Version
0.2.0
Package Id
p@0.2.0
Size
5.43 kB
NPM Version
1.1.0-2
Node Version
v0.6.7
Cumulative downloads
Total Downloads
Last Day
8.2%
53
Compared to previous day
Last Week
22.3%
356
Compared to previous week
Last Month
-19.5%
1,742
Compared to previous month
Last Year
33.1%
26,609
Compared to previous year
pattern
is a way to do pattern matching in javascript that helps you with asynchronous iterations
1var map = require('../pattern')() 2 , _, f, ac 3 ; 4 5map(f, [], ac, function done(_, _, ac) { return console.error(ac); }); 6map(f, _, ac, function all(f, l, ac) { 7 ac.push(f(l.shift())); // head 8 map(f, l, ac); // l is now tail 9}); 10 11map(function plusone(x) { return x+1; }, [1,2,3], []);
1// check `samples/nodetuts.js` for working code 2insert_all([], function () { console.log('done'); }); 3insert_all(_, function (l) { 4 insert_element(l.shift(), function (elem) { 5 console.log('‣ ', elem); 6 insert_all(l); 7 }); 8}); 9 10insert_all([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
the first pattern in pattern
sets the arity of the function to execute
1// first call sets arity #1 2// when this condition is met it logs the message done 3insert_all([], function () { console.log('done'); });
then we normally register the iteration pattern
1// var _; was set in the top, value is undefined
2insert_all(_, function (l) {
if you then call insert_all
where the argument count matches arity, pattern
knows its time to execute
1// one argument, arity #1 2// run forest, run 3insert_all([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
this is the code you would normally write to do the same thing in javascript
npm install p
var p = require('p');
there are samples in the samples
directory. check them out
pointfree style (note i'm just kidding)
everyone is welcome to contribute. patches, bug-fixes, new features
pattern
git checkout -b feature_name
git push origin feature_name
git clone git://github.com/dscape/p.git
(oO)--',-
in caos
copyright 2012 nuno job <nunojob.com> (oO)--',--
licensed under the apache license, version 2.0 (the "license"); you may not use this file except in compliance with the license. you may obtain a copy of the license at
http://www.apache.org/licenses/LICENSE-2.0
unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "as is" basis, without warranties or conditions of any kind, either express or implied. see the license for the specific language governing permissions and limitations under the license
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-05-12
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