# underline

> Bound underscore functions

Latest version **1.0.4** (published 2016-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install underline
pnpm add underline
yarn add underline
bun add underline
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2016-03-01 |
| First published | 2015-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Ankur Patel |
| Maintainers | ankurpatel |
| Keywords | underline, underline.js, underscore, lodash, es7, bind |

## Links

- npm: https://www.npmjs.com/package/underline
- Repository: https://github.com/ankurp/underline
- Homepage: http://ankurp.github.io/underline/
- Issues: https://github.com/ankurp/underline/issues
- npm.io page: https://npm.io/package/underline

## Dependencies (1)

- [underscore](https://npm.io/package/underscore.md) ^1.8.3

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2016-03-01
- 1.0.2 — 2015-10-10
- 1.0.1 — 2015-10-07

## README

# Underline.js - Underscore.js for modern Javascript

[![npm package](https://img.shields.io/npm/v/underline.svg?style=flat-square)](https://www.npmjs.org/package/underline)
[![Dependency Status](https://david-dm.org/ankurp/underline.svg?style=flat-square)](https://david-dm.org/ankurp/underline)

Using modern ES7 functional bind `::` syntax you can now call the underscore.js function the 'right' or non-functional way. underline.js is a thin layer between your code and underscore.js which binds all underscore functions called to the target object.

## Example

```javascript
import { difference, all, keys, pluck } from 'underline'; // Require functions needed

// Differece of arrays
[12, 1, 2, 3, 10, 11]::difference([10, 11, 12])
// => [1, 2, 3]

// Check for all elements are less than 10
[1, 2, 3, 10]::all((e) => e < 10)
// => false

// Extract Keys
{ a: 1, b: 2 }::keys()
// => ["a", "b"]

// Pluck property
[
  {name: 'moe', age: 40},
  {name: 'larry', age: 50},
  {name: 'curly', age: 60}
]::pluck('name')
// => ["moe", "larry", "curly"]

/////
// VS
/////

// Underscore way for difference
_.difference([12, 1, 2, 3, 10, 11], [10, 11, 12])

// all
_.all([1, 2, 3, 10], (e) => e < 10)

// keys
_.keys({ a: 1, b: 2})
// OR
Object.keys({ a: 1, b: 2})

// and pluck
_.pluck([
  {name: 'moe', age: 40},
  {name: 'larry', age: 50},
  {name: 'curly', age: 60}
], 'name')
```

**Underline supports chaining without wrapping like underscore**

```javascript
// Chaining difference and all
[12, 1, 2, 3, 10, 11]::difference([10, 11, 12])
                     ::all((e) => e < 10)
// => true

/////
// VS
/////

// Too much typing to chain in underscore and get its value
_.chain([12, 1, 2, 3, 10, 11]).difference([10, 11, 12])
                              .all((e) => e < 10)
                              .value()
```

## Try it

Try it out in the [REPL](http://ankurp.github.io/underline/)

## Usage

To get started you will need to use [Babel](https://babeljs.io) transpiler with experimental feature [es7.functionBind](http://babeljs.io/blog/2015/05/14/function-bind/#usage) enabled. Then:

1. Install this library using npm - `npm install --save underline`
2. Import functions as needed - `import { map } from 'underline'`
3. Call a function using `::` operator as such `[1, 2, 3]::map((e) => e * 10)`

## Functions Available

All of the functions available in [underscore.js](http://underscorejs.org/) are available in `underline.js`.

* `iteratee`
* `forEach`
* `each`
* `collect`
* `map`
* `inject`
* `foldl`
* `reduce`
* `foldr`
* `reduceRight`
* `detect`
* `find`
* `select`
* `filter`
* `reject`
* `all`
* `every`
* `any`
* `some`
* `include`
* `includes`
* `contains`
* `invoke`
* `pluck`
* `where`
* `findWhere`
* `max`
* `min`
* `shuffle`
* `sample`
* `sortBy`
* `groupBy`
* `indexBy`
* `countBy`
* `toArray`
* `size`
* `partition`
* `take`
* `head`
* `first`
* `initial`
* `last`
* `drop`
* `tail`
* `rest`
* `compact`
* `flatten`
* `without`
* `unique`
* `uniq`
* `union`
* `intersection`
* `difference`
* `zip`
* `unzip`
* `object`
* `findIndex`
* `findLastIndex`
* `sortedIndex`
* `indexOf`
* `lastIndexOf`
* `range`
* `bind`
* `partial`
* `bindAll`
* `memoize`
* `delay`
* `defer`
* `throttle`
* `debounce`
* `wrap`
* `negate`
* `compose`
* `after`
* `before`
* `once`
* `keys`
* `allKeys`
* `values`
* `mapObject`
* `pairs`
* `invert`
* `methods`
* `functions`
* `extend`
* `assign`
* `extendOwn`
* `findKey`
* `pick`
* `omit`
* `defaults`
* `create`
* `clone`
* `tap`
* `isMatch`
* `isEqual`
* `isEmpty`
* `isElement`
* `isArray`
* `isObject`
* `isArguments`
* `isFunction`
* `isString`
* `isNumber`
* `isDate`
* `isRegExp`
* `isError`
* `isFinite`
* `isNaN`
* `isBoolean`
* `isNull`
* `isUndefined`
* `has`
* `noConflict`
* `identity`
* `constant`
* `noop`
* `property`
* `propertyOf`
* `matches`
* `matcher`
* `times`
* `random`
* `now`
* `escape`
* `unescape`
* `result`
* `uniqueId`
* `templateSettings`
* `template`
* `chain`
* `mixin`

---
_Source: https://npm.io/package/underline · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
