Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@allnulled/asynchandler
Advanced tools
Callback adapter to use in a Promise.
To adapt callbacks paradigm
to promises paradigm
in a nutshel.
$ npm i -s @allnulled/asynchandler
This example demonstrates how to use asynchandler
with the node fs
native module to read and write files using the asynchronous API:
const asynchandler = require("@allnulled/asynchandler");
const example = async function() {
await new Promise((ok, fail) => {
fs.writeFile("file.txt", "Contents of the file", "utf8", asynchandler(ok, fail));
});
await new Promise(function(ok, fail) {
fs.readFile("file.txt", "utf8", asynchandler(ok, fail));
});
};
example();
The source code of this module is very simple:
module.exports = function(ok, fail) {
return function(error, data) {
if (error) {
fail(error);
return;
}
ok(data);
return;
}
};
This project is released under WTFPL
or What The Fuck Public License
. Do what you want.
FAQs
Callback adapter to use in a Promise.
We found that @allnulled/asynchandler 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.