0.0.1 • Published 9 years ago

quicklambda v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

node-quicklambda

A tiny module for generating property access functions with a tiny amount of code

Usage

var _ = require('quicklambda');

var fruits = [{
    name: 'Apple',
    extra: {
        taste: 'Sweet',
        shape: 'dimpled sphere'
    }
}, {
    name: 'Pear',
    extra: {
        taste: 'Sweet',
        shape: 'lop-sided stretched sphere'
    }
}, {
    name: 'Lemon',
    extra: {
        taste: 'Sour',
        shape: 'elongated sphere'
    }
}];

var fruitNames = fruits.map(_.name);
// ['Apple', 'Pear', 'Lemon']

var fruitTastes = fruits.map(_.extra.taste);
// ['Sweet', 'Sweet', 'Sour']

Note

Proxies must be available to use this module.

Enable Proxies in node

node --harmony-proxies