
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Most asynchronous functions are fine to run concurrently with themselves. But when they're not—lockify them.
Lockify takes an async function (or any function that returns a promise), and lets you limit concurrency. By default the maximum concurrency is 1.
Let's say we're getting dog descriptions from an API:
const headers = { Authorization: 'Bearer abc123xyz890' }
function fetchDog(name) {
const url = `http://example.com/dog/${name}`
return fetch(url, { headers }).then(res => res.json())
}
const allDogs = Promise.all(
['Fido', 'Princess', 'Fluffy'].map(fetchDog)
)
Unfortunately this API doesn't allow your key to fetch more than one dog at a time. Lockify can help with that:
const headers = { Authorization: 'Bearer abc123xyz890' }
function fetchDog(name) {
const url = `http://example.com/dog/${name}`
return fetch(url, { headers }).then(res => res.json())
}
const politeFetchDog = lockify(fetchDog)
const allDogs = Promise.all(
['Fido', 'Princess', 'Fluffy'].map(politeFetchDog)
)
Or, if you've paid more for the "fetch two dogs at a time" plan with the dog description service:
const politeFetchDog = lockify(fetchDog, 2)
FAQs
If your async function shouldn't run concurrently, lockify it!
The npm package lockify receives a total of 1 weekly downloads. As such, lockify popularity was classified as not popular.
We found that lockify demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.