Gathering detailed insights and metrics for @duzun/async-series
Gathering detailed insights and metrics for @duzun/async-series
Gathering detailed insights and metrics for @duzun/async-series
Gathering detailed insights and metrics for @duzun/async-series
npm install @duzun/async-series
Typescript
Module System
Node Version
NPM Version
71.1
Supply Chain
98.8
Quality
75.6
Maintenance
100
Vulnerability
100
License
JavaScript (71.88%)
TypeScript (28.12%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
1,828
Last Day
2
Last Week
4
Last Month
47
Last Year
160
1 Stars
20 Commits
2 Watching
3 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.4-ts
Package Id
@duzun/async-series@1.0.4-ts
Unpacked Size
24.29 kB
Size
5.42 kB
File Count
10
NPM Version
8.1.2
Node Version
17.1.0
Cumulative downloads
Total Downloads
Last day
100%
2
Compared to previous day
Last week
-86.7%
4
Compared to previous week
Last month
327.3%
47
Compared to previous month
Last year
-71.6%
160
Compared to previous year
Asynchronously process a list of items consecutively.
Even though the processing is asynchronous, it is never done in parallel.
1npm i -S @duzun/async-series
This library can be included either as an ESM or UMD.
1import { 2 forEach as eachSeries, 3 map as mapSeries, 4 reduce as reduceSeries 5} from '@duzun/async-series';
1const { 2 forEach: eachSeries, 3 map : mapSeries, 4 reduce : reduceSeries, 5} = require('@duzun/async-series');
1require('https://unpkg.com/@duzun/async-series', (asyncSeries) => { 2 const { 3 forEach: eachSeries, 4 map : mapSeries, 5 reduce : reduceSeries, 6 } = asyncSeries; 7 8 // ... 9});
1<script src="https://unpkg.com/@duzun/async-series"></script> 2<script> 3const { 4 forEach: eachSeries, 5 map : mapSeries, 6 reduce : reduceSeries, 7} = asyncSeries; 8</script>
[async ]iteratee(value, index, array)
Process file contents of a directory, asynchronously & consecutively.
1const fs = require('mz/fs'); 2const { forEach: eachSeries } = require('@duzun/async-series'); 3 4(async () => { 5 let files = await fs.readdir('.'); 6 let results = await eachSeries(files, async (filename, idx) => { 7 if((await fs.stat(filename)).isDirectory()) return; 8 let contents = await fs.readFile(filename); 9 10 // Do some heavy processing here... 11 }); 12})();
[async ]iteratee(value, index, array)
Get file contents of a directory, asynchronously & consecutively;
1const fs = require('mz/fs'); 2const { map: mapSeries } = require('@duzun/async-series'); 3 4(async () => { 5 let files = await fs.readdir('.'); 6 let contents = await mapSeries(files, async (filename, idx) => { 7 if((await fs.stat(filename)).isDirectory()) return; 8 return fs.readFile(filename, 'utf8'); 9 }); 10 contents = contents.filter((x) => x); 11})();
[async ]reducer(accumulator, currentValue, index, array)
Calculate file sizes in a directory, asynchronously & consecutively.
1const fs = require('mz/fs'); 2const { reduce: reduceSeries } = require('@duzun/async-series'); 3 4(async () => { 5 let files = await fs.readdir('.'); 6 let size = await reduceSeries(files, async (size, filename, idx) => { 7 let stats = await fs.stat(filename); 8 if(stats.isDirectory()) return size; 9 return size + stats.size; 10 }, 0); 11 12 console.log('size: ', size); 13})(); 14
Why not? :)
I know, there is a great library Async.js, which already has eachSeries, mapSeries and reduce and many other functions.
This library is < 900 bytes minified, and < 500 bytes when also gzipped.
And if you include it with rollup.js, you only get the function you've imported.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
7 existing vulnerabilities detected
Details
Reason
Found 0/20 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 SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-02-03
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