MADE IN SWITZERLAND
[](https://coveralls.io/r/1-liners/1-liners?branch=master)
[](https://travis-ci.org/1-liners/1-liners)
[](https://david-dm.org/1-liners/1-liners)
[](http://badge.fury.io/js/1-liners)
[](https://github.com/1-liners/1-liners/milestones/1.0)
[](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][docs]** (and counting). Each hand-crafted with love and attention.
[docs]: ./documentation
## 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. 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`.
[fit in one readable line of code]: https://github.com/1-liners/1-liners/blob/28b02d0939d6bb4034693e48440f450141453ae9/module/flip.js#L18
[have no side-effects]: ./documentation#extend
[have a fixed number of arguments]: ./documentation#shave
[deal with data in an immutable way]: ./documentation#put
[take data as the last argument]: ./documentation#split
[be in a separate micro-module]: https://github.com/1-liners/1-liners/blob/28b02d0939d6bb4034693e48440f450141453ae9/module/compose.js
[be thoroughly tested]: https://coveralls.io/r/1-liners/1-liners?branch=master
[have great documentation]: ./documentation
[native object methods]: ./documentation#reduce
[language constructs]: ./documentation#plus
## Usage
### Install
```
$ npm install --save 1-liners
```
### Usage in ES5
```js
// The lightweight, recommended way:
var map = require('1-liners/map');
// Sometimes practical:
var map = require('1-liners').map;
```
### Usage in ES 2015 (formerly ES6)
```js
// The lightweight, recommended way:
import map from '1-liners/module/map';
// Sometimes practical:
import { map, filter } from '1-liners/module';
```
## API
Checkout the [documentation](./documentation)
## Maintainers
| [](https://github.com/stoeffel) | [](https://github.com/tomekwi) | [](https://github.com/hemanth) |
| :--:|:--:|:--: |
| [stoeffel](https://github.com/stoeffel) | [tomekwi](https://github.com/tomekwi) | [hemanth](https://github.com/hemanth) |
| [](https://github.com/davidchase) | [](https://github.com/tristaaan) |
| :--:|:--: |
| [davidchase](https://github.com/davidchase) | [tristaaan](https://github.com/tristaaan) |
created with [gh-contributors-table](https://github.com/stoeffel/gh-contributors-table)
## License
MIT © [stoeffel](http://schtoeffel.ch) [tomekwi](http://github.com/tomekwi) [hemanth](http://www.h3manth.com/) [davidchase](http://github.com/davidchase) [tristaaan](http://github.com/tristaaan)