tuple

Dynamic key object creation utility

npm install tuple
5 downloads in the last month

tuple

Dynamic key object creation utility.

Installation

$ component install component/tuple
$ npm install tuple

Example

Useful for when you find yourself doing something like:

var obj = {};
obj[someDynamicKey] = 'value';
db.query(obj);

which may now just be:

db.query(tuple(someDynamicKey, 'value));

API

tuple(key, value, ...)

Key / value pairs in sequence.

var t = require('tuple');
var key = 'name';
var obj = t(key, 'tobi');
// => { name: tobi }

License

MIT

npm loves you