aureooms/js-functools


functions code bricks for JavaScript

http://aureooms.github.io/js-functools/

License: AGPL-3.0

Language: JavaScript


js-functools

Function tools for JavaScript. Parent is aureooms/js-library.

let j = ( a , b , c , x ) => a * x**2 + b * x + c ;
let p = partial( j , [ 5 , 4 , -1 ] ) ;
p( -1 ) ; // 5 - 4 - 1 = 0

NPM license NPM version Bower version Build Status Coverage Status Dependencies Status devDependencies Status Code Climate NPM downloads per month GitHub issues Inline docs

Can be managed through jspm, duo, component, bower, ender, jam, spm, and npm.

Install

jspm

jspm install github:aureooms/js-functools
# or
jspm install npm:aureooms-js-functools

duo

No install step needed for duo!

component

component install aureooms/js-functools

bower

bower install aureooms-js-functools

ender

ender add aureooms-js-functools

jam

jam install aureooms-js-functools

spm

spm install aureooms-js-functools --save

npm

npm install aureooms-js-functools --save

Require

jspm

let functools = require( "github:aureooms/js-functools" ) ;
// or
import functools from 'aureooms-js-functools' ;

duo

let functools = require( "aureooms/js-functools" ) ;

component, ender, spm, npm

let functools = require( "aureooms-js-functools" ) ;

bower

The script tag exposes the global variable functools.

<script src="bower_components/aureooms-js-functools/js/dist/functools.min.js"></script>

Alternatively, you can use any tool mentioned here.

jam

require( [ "aureooms-js-functools" ] , function ( functools ) { ... } ) ;

Use

let f = x => x + 1 ;
let g = x => 2 * x ;
let odd = compose( [ f , g ] ) ;
odd( 7 ) ; // 2 * 7 + 1 = 15

let j = ( a , b , c , x ) => a * x**2 + b * x + c ;
let p = partial( j , [ 5 , 4 , -1 ] ) ;
p( -1 ) ; // 5 - 4 - 1 = 0

let add = curry( ( x , y ) => x + y , 2 ) ;
add(2)(3) ; // 5

Reference

Project Statistics

Sourcerank 9
Repository Size 121 KB
Stars 1
Forks 1
Watchers 1
Open issues 3
Dependencies 1
Contributors 1
Tags 15
Created
Last updated
Last pushed

Top Contributors See all

Aurélien Ooms

Packages Referencing this Repo

aureooms-js-functools
functions code bricks for JavaScript
Latest release v2.0.3 - Published - 1 stars
aureooms-js-functools
functions code bricks for JavaScript
Latest release 2.0.3 - Updated - 1 stars
aureooms-js-functools
functions code bricks for JavaScript
Latest release 2.0.3 - Updated - 1 stars

Recent Tags See all

v2.0.3 April 29, 2015
v2.0.2 April 29, 2015
v2.0.1 April 29, 2015
v2.0.0 April 29, 2015
v1.2.2 April 22, 2015
v1.2.1 February 11, 2015
v1.2.0 January 22, 2015
v1.1.0 January 22, 2015
v1.0.1 January 22, 2015
v1.0.0 October 22, 2014
v0.0.5 October 19, 2014
v0.0.4 October 18, 2014
v0.0.3 October 14, 2014
v0.0.2 October 11, 2014
v0.0.1 October 08, 2014

Something wrong with this page? Make a suggestion

Last synced: 2016-05-27 17:31:52 UTC

Login to resync this repository