Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Small module that allows you to guard a call to a function.
npm install nanoguard
const Nanoguard = require('nanoguard')
const guard = new Nanoguard()
guard.wait()
// When the amount of wait() calls reflect continue() calls ready is called
guard.ready(function () {
console.log('Ready to continue!')
})
guard.continue()
const guard = new Nanoguard()
Make a new guard instance
guard.wait()
Increment the wait counter. Non-owners of the guard can use this to defer the ready function of the guard owner.
guard.continue()
Decrement the wait counter on the next tick. If the counter is 0
it calls all pending
ready functions.
If you called wait() you have to call continue() at some point.
guard.continueSync()
Same as guard.continue()
but decrements in the same tick.
const cont = guard.waitAndContinue()
Calls wait and returns a function that when called calls continue() once no matter how many times it is called.
guard.ready(fn)
Pass a function that is called when the wait counter is 0
.
guard.destroy()
Force sets the wait counter to 0
forever.
Should only be called by the owner of the guard.
const bool = guard.waiting
Boolean indicating if the wait counter is > 0
.
MIT
FAQs
Small module that allows you to guard a call to a function.
The npm package nanoguard receives a total of 454 weekly downloads. As such, nanoguard popularity was classified as not popular.
We found that nanoguard 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.