Gathering detailed insights and metrics for @hideokamoto/sequential-promise
Gathering detailed insights and metrics for @hideokamoto/sequential-promise
Gathering detailed insights and metrics for @hideokamoto/sequential-promise
Gathering detailed insights and metrics for @hideokamoto/sequential-promise
npm install @hideokamoto/sequential-promise
Typescript
Module System
Node Version
NPM Version
TypeScript (91.87%)
JavaScript (8.13%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
35 Commits
1 Watchers
4 Branches
2 Contributors
Updated on Jun 29, 2021
Latest Version
1.1.2
Package Id
@hideokamoto/sequential-promise@1.1.2
Unpacked Size
58.53 kB
Size
45.24 kB
File Count
9
NPM Version
7.7.6
Node Version
15.14.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
20
Simply async task runnner as sequential
https://hideokamoto.github.io/sequential-promise/
We have to run the task as asynchronous
1import * as moment from 'moment' 2 3const dummy = async () => { 4 return new Promise(resolve => setTimeout(resolve, 1000)) 5} 6 7const asyncFunc = async () => { 8 9 const arr = [1,2,3,4,5] 10 const result = await Promise.all(arr.map(async i => { 11 const start = moment() 12 console.log(`Number: ${i}`) 13 console.log(`Start: ${start.toISOString()}`) 14 await dummy() 15 console.log(`End ${moment().toISOString()}`) 16 console.log(`${moment().diff(start, 'seconds')} sec`) 17 console.log(' ') 18 return i + 1 19 })) 20 return result 21}) 22 23asyncFunc().then(result => console.log(result))
The function will run async.
1Number: 1 2Start: 2019-08-30T07:52:43.862Z 3Number: 2 4Start: 2019-08-30T07:52:43.862Z 5Number: 3 6Start: 2019-08-30T07:52:43.863Z 7Number: 4 8Start: 2019-08-30T07:52:43.863Z 9Number: 5 10Start: 2019-08-30T07:52:43.863Z 11End 2019-08-30T07:52:44.866Z 121 sec 13 14End 2019-08-30T07:52:44.866Z 151 sec 16 17End 2019-08-30T07:52:44.867Z 181 sec 19 20End 2019-08-30T07:52:44.867Z 211 sec 22 23End 2019-08-30T07:52:44.867Z 241 sec 25 26[ 2, 3, 4, 5, 6 ]
To use the package, we can run sequential
1import * as moment from 'moment' 2import sequentialPromise from '@hideokamoto/sequential-promise' 3 4sequentialPromise<number, string>([1,2,3,4,5], async (i) => { 5 const start = moment() 6 console.log(`Number: ${i}`) 7 console.log(`Start: ${start.toISOString()}`) 8 await dummy() 9 console.log(`End ${moment().toISOString()}`) 10 console.log(`${moment().diff(start, 'seconds')} sec`) 11 console.log(' ') 12 return `${i} + 2 = ${i + 2}` 13}).then(r => console.log(r))
1const moment = require('moment') 2const sequentialPromise = require('@hideokamoto/sequential-promise') 3 4sequentialPromise([1,2,3,4,5], async (i) => { 5 const start = moment() 6 console.log(`Number: ${i}`) 7 console.log(`Start: ${start.toISOString()}`) 8 await dummy() 9 console.log(`End ${moment().toISOString()}`) 10 console.log(`${moment().diff(start, 'seconds')} sec`) 11 console.log(' ') 12 return `${i} + 2 = ${i + 2}` 13}).then(r => console.log(r))
This is the result.
1 Number: 1 2 Start: 2019-08-30T07:35:00.175Z 3 End 2019-08-30T07:35:01.182Z 4 1 sec 5 6 Number: 2 7 Start: 2019-08-30T07:35:01.184Z 8 End 2019-08-30T07:35:02.188Z 9 1 sec 10 11 Number: 3 12 Start: 2019-08-30T07:35:02.188Z 13 End 2019-08-30T07:35:03.194Z 14 1 sec 15 16 Number: 4 17 Start: 2019-08-30T07:35:03.194Z 18 End 2019-08-30T07:35:04.200Z 19 1 sec 20 21 Number: 5 22 Start: 2019-08-30T07:35:04.200Z 23 End 2019-08-30T07:35:05.206Z 24 1 sec 25 26 [ '1 + 2 = 3', '2 + 2 = 4', '3 + 2 = 5', '4 + 2 = 6', '5 + 2 = 7' ]
1// clone 2$ git clone git@github.com:hideokamoto/sequential-promise.git 3$ cd sequential-promise 4 5// setup 6$ yarn 7 8// Unit test 9$ yarn test 10or 11$ yarn run test:watch 12 13// Lint 14$ yarn run lint 15or 16$ yarn run lint --fix 17 18// Build 19$ yarn run build 20 21// Rebuild docs 22$ yarn run doc
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/8 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
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-07-07
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