tuple

0.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i tuple

Weekly Downloads

4

Version

0.0.1

License

none

Last publish

Collaborators

  • tjholowaychuk