
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Observableify a callback-style function
$ npm install --save obsify
const fs = require('fs');
const obsify = require('obsify');
obsify(fs.readFile)('package.json', 'utf8')
.map(data => JSON.parse(data))
.subscribe(data => {
console.log(data.name);
//=> 'obsify'
});
// or observableify all methods in a module
obsify(fs).readFile('package.json', 'utf8')
.map(data => JSON.parse(data))
.subscribe(data => {
console.log(data.name);
//=> 'obsify'
});
Type: function, object
Callback-style function or module whose methods you want to observableify.
Type: array of (string|regex)
Methods in a module to observableify. Remaining methods will be left untouched.
Type: array of (string|regex)
Default: [/.+Sync$/]
Methods in a module not to observableify. Methods with names ending with 'Sync' are excluded by default.
Type: boolean
Default: false
By default, if given module is a function itself, this function will be observableified. Turn this option on if you want to observableify only methods of the module.
const obsify = require('obsify');
function fn() {
return true;
}
fn.method = (data, callback) => {
setImmediate(() => {
callback(data, null);
});
};
// observableify methods but not fn()
const observableFn = obsify(fn, {excludeMain: true});
if (observableFn()) {
observableFn.method('hi').subscribe(data => {
console.log(data);
});
}
MIT © Sam Verschueren
FAQs
Observableify a callback-style function
We found that obsify 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.