
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
Another generator runner
yielded doesn't help you with callback generator, it uses promises. To convert a function with a callback to a promise, you can use springbokjs-utils promiseCallback.
npm install --save yielded
var Y = require('yielded');
var fs = require('springbokjs-utils/fs');
Y.run(function* () {
try {
var fileContents = yield fs.readFile('./myFile.json');
console.log(JSON.parse(fileContents));
} catch (err) {
console.error(err);
}
});
You can use arrays with values and promises:
Y.run(function* () {
var result = yield [
1,
2,
new Promise(function(resolve, reject) {
setTimeout(function() {
resolve(3);
});
}),
new Promise(function(resolve, reject) {
resolve(4);
}),
];
console.log(result);
// [1, 2, 3, 4]
});
var Y = require('yielded');
var fs = require('springbokjs-utils/fs');
var readFileContents = function* () {
try {
var fileContents = yield fs.readFile('./myFile.json');
console.log(JSON.parse(fileContents));
} catch (err) {
console.error(err);
}
};
Y.run(function* () {
var result = yield readFileContents();
console.log(result);
});
This library is an attempt to understand generators and yields, the result of my research of other libraries and taking the parts I like from them. Libraries I took inspiration from are:
FAQs
Another generator runner
We found that yielded 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.