Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
unless-async
Advanced tools
Async unless
conditional flow inspired by Ruby.
Node 6+
Because programming is fun, and implementing what you think you know shows you what you've yet to learn.
npm i -S unless-async
const unless = require('unless-async');
const foo = false;
unless(foo, () => console.log('Foo is false so I am called!'));
const bar = true;
unless(bar, () => console.log('Bar is true so I am NOT called!'));
unless(user.isAuthenticated(), () => authenticate(user))
.then(() => {
return mail.send(user.email);
});
const isAdmin = User.find(params.userId).then(u => u.isAdmin);
return unless(isAdmin, () => {
throw new Error('Forbidden');
})
.then(() => Message.find(params));
unless(
Promise<any>|boolean condition,
function action
) -> Promise
Creates a promise that is resolved with the given action function when false, otherwise resolves undefined.
npm test
MIT
FAQs
Async unless conditional flow.
The npm package unless-async receives a total of 1 weekly downloads. As such, unless-async popularity was classified as not popular.
We found that unless-async 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.