lmbd

0.1.0 • Public • Published

lmbd

Sugar for your tinest of functions.

Why

function(){} is a lot of noise, ya know? Also, i was reading a blog post, and got a little jelly of ruby.

Example

var λ = require('lmbd')
 
var people = [ 
  { name: 'super-bach' },
  { name: 'tele man'  },
  { name: 'mozart.. boy?'}
]
 
var names = people.map(λ('a.name'))

API

λ(String) -> function

Accepts a single expression, in string form. It'll add in parameters as needed for your variables; no worries!.

var λ = require('lmbd')
 
var add = λ('a + b'),
    inc = λ('a + 1')
    wrap = λ('b + a + b')
    
add(1, 2) //= 3
add('foo', 'bar') //= 'foobar'
inc(1) //=2
wrap('"', 'foo') //= '"foo"'

Install

npm install lmbd

Readme

Keywords

none

Package Sidebar

Install

npm i lmbd

Weekly Downloads

0

Version

0.1.0

License

BSD

Last publish

Collaborators

  • hughfdjackson