Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Promises are a popular solution to some of the drawbacks of the callback-style async APIs dominant in node.js libraries. But it's awkward to write an node.js application using promises when all the libraries you want to use are callback-based.
Hence Promisify. It converts callback-style APIs to use promises instead. To use it, you provide a concise description of the structure of the API to tell Promisify what to convert. For example, here is a sample which converts a substantial portion of the MongoDB driver API to Promises:
var promisify = require('promisify');
var promisify_collection = promisify.object({
insert: promisify.cb_func(),
remove: promisify.cb_func(),
findOne: promisify.cb_func(),
find: promisify.func(promisify.object({
stream: promisify.func(promisify.read_stream())
}))
});
var promisify_connection = promisify.object({
collection: promisify.cb_func(promisify_collection),
createCollection: promisify.cb_func(promisify_collection),
dropCollection: promisify.cb_func()
});
var promisify_mongodb = promisify.object({
connect: promisify.cb_func(promisify_connection)
});
var mongodb = promisify_mongodb(require('mongodb'));
Promisify is built upon the when.js implementation of promises.
FAQs
Convert callback-based APIs to promises
The npm package promisify receives a total of 219,004 weekly downloads. As such, promisify popularity was classified as popular.
We found that promisify 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.