![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Make methods yieldable (via y$ name prefix). It's like thunkify, but for whole classes (prototypes) and objects (instances).
// Turns this
obj.someAsyncMethod(arg1, arg2, arg3, function(err, result) {...});
// By doing this
yieldable(obj);
// Into this
var result = yield obj.y$someAsyncMethod(arg1, arg2, arg3);
// (notice a new method with y$ prefix, origin callback-style method remains unaffected)
npm install yieldable --save
yieldable(src, [prefix])
Make methods yieldable.
src
(required): Class, Object or an Array of Classes/Objects.prefix
(optional): Custom name prefix for yieldable methods' variants. Default y$
.var dbDriver = require('some-database-driver');
var co = require('co');
var yieldable = require('yieldable');
// Let's make dbDriver.Client's methods yieldable
yieldable(dbDriver.Client);
co(function*() {
var db = new dbDriver.Client({host:'localhost', dbname:'myDatabase'});
yield db.y$connect();
var result = yield db.y$query('SELECT * FROM users WHERE username = ?', ['hajovsky']);
console.log(result);
yield db.y$disconnect();
})();
var dbDriver = require('some-database-driver');
var co = require('co');
var yieldable = require('yieldable');
co(function*() {
// Create instance of dbDriver.Client and make it's methods yieldable
var db = yieldable(new dbDriver.Client({host:'localhost', dbname:'myDatabase'}));
yield db.y$connect();
var result = yield db.y$query('SELECT * FROM users WHERE username = ?', ['hajovsky']);
console.log(result);
yield db.y$disconnect();
})();
var dbDriver = require('some-database-driver');
var co = require('co');
var yieldable = require('yieldable');
yieldable(dbDriver.Client, 'yyy_');
co(function*() {
var db = new dbDriver.Client({host:'localhost', dbname:'myDatabase'});
yield db.yyy_connect();
var result = yield db.yyy_query('SELECT * FROM users WHERE username = ?', ['hajovsky']);
console.log(result);
yield db.yyy_disconnect();
})();
var cql = require('node-cassandra-cql');
var MongoClient = require('mongodb').MongoClient;
var redis = require("redis");
var redisClient = redis.createClient();
var yieldable = require('yieldable');
yieldable([
cql.Client,
MongoClient,
redisClient
]);
FAQs
Make methods yieldable
The npm package yieldable receives a total of 1 weekly downloads. As such, yieldable popularity was classified as not popular.
We found that yieldable 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.