Giter VIP home page Giter VIP logo

MADE IN SWITZERLAND

Coverage Status Build Status Dependency Status npm version Stability: unstable Join the chat at https://gitter.im/1-liners/1-liners

Functional tools that couldn’t be simpler.

We’re proud to present 1-liners – a dead simple functional utility belt. 137 one-liner functions (and counting). Each hand-crafted with love and attention.










Our decalogue

You get a product of top-quality functional programming craftmanship. Each function follows the KISS principle, which we’ve broken down into ten strict rules.

We always follow them. You have our word.



1-liners


  1. Each function shall fit in one readable line of code
    – take a glimpse at the source and you know exactly what’s going on.
     

  2. Each function shall have no side-effects
    – you can use it with confidence.
     

  3. Each function shall have a fixed number of arguments
    – it’s dead easy to bind, curry and uncurry, apply partially, implode and explode.
     

  4. Each function shall deal with data in an immutable way
    – no more debugging nightmares.
     

  5. Each function shall take data as the last argument
    – this makes currying and composing new functions a breeze.
     

  6. Each function shall be in a separate micro-module
    – you only load/bundle the single 1-liner you need.
     

  7. Each function shall be thoroughly tested
    – 100% code coverage guaranteed. We even test if every function fits in one line!
     

  8. Each function shall have great documentation
    – the docs explain usage, present the source, and link to the specs.
     

  9. We shall provide functional versions of native object methods
    – like reduce(callback, array) for array.reduce(callback).
     

  10. We shall provide functional versions of language constructs
    – like plus(a, b) for a + b.
     

Usage

Install

$ npm install --save 1-liners

Usage in ES5

// The lightweight, recommended way:
var map = require('1-liners/map');

// Sometimes practical:
var map = require('1-liners').map;

Usage in ES 2015 (formerly ES6)

// The lightweight, recommended way:
import map from '1-liners/module/map';

// Sometimes practical:
import { map, filter } from '1-liners/module';

API

Checkout the documentation

Maintainers

stoeffel tomekwi hemanth
stoeffel tomekwi hemanth
davidchase tristaaan
davidchase tristaaan

created with gh-contributors-table

License

MIT © stoeffel tomekwi hemanth davidchase tristaaan

1-liners's Projects

1-liners icon 1-liners

Functional tools that couldn’t be simpler.

get-modules icon get-modules

Utility for 1-liners build: get all filenames in the `./modules` folder

logos icon logos

:house_with_garden: Home for the logos of 1-liners

module-indexer icon module-indexer

Utility for 1-liners build: creates a `index.js` for es6 modules

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.