
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
Promise based task queue with concurrency limit.
const https = require('https')
const url = require('url')
const queue = require('queue.ls')
const addTask = queue(3)
for (let i = 1; i <= 20; i++) {
addTask(fetchPage(i)).then(result => console.log(result))
}
function fetchPage(i) {
const options = url.parse(
`https://api.github.com/repos/jquery/jquery/commits?page=${i}`)
options.headers = { 'User-Agent': 'Awesome-Octocat-App' }
return () => new Promise(resolve =>
https.get(options, res => {
const buffer = []
res.on('data', chunk => buffer.push(chunk))
res.on('end', () => resolve(JSON.parse(buffer.join(''))))
}))
};
require! https
require! url
queue = require \queue.ls
add-task = queue 3
fetch-page = (i) ->
options = url.parse \
"https://api.github.com/repos/jquery/jquery/commits?page=#i"
options <<< headers: 'User-Agent': \Awesome-Octocat-App
-> new Promise (resolve) ->
res <- https.get options
buffer = []
res.on \data buffer~push
<- res.on \end
resolve JSON.parse buffer.join ''
for i from 1 to 20
add-task fetch-page i .then -> console.log it
npm i --save queue.ls
concurrency: Maximum number of tasks should run concurrently.Returns a function to add a task.
The function returned by queue().
Returns a promise, resolves to the result of task.
Starts the task immediately if concurrency limit is not reached, enqueues it otherwise. Queued tasks start after some previous tasks end, in the order they added.
FAQs
Promise based task queue with concurrency limit
The npm package queue.ls receives a total of 4 weekly downloads. As such, queue.ls popularity was classified as not popular.
We found that queue.ls demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.