• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

LICENSED24-Sep-20231.1 KiB2217

README.mdD24-Sep-20232.2 KiB6546

index.jsD24-Sep-2023509 3824

package.jsonD24-Sep-2023856 4443

README.md

1# longest [![NPM version](https://badge.fury.io/js/longest.svg)](http://badge.fury.io/js/longest)  [![Build Status](https://travis-ci.org/jonschlinkert/longest.svg)](https://travis-ci.org/jonschlinkert/longest)
2
3> Get the longest item in an array.
4
5## Install with [npm](npmjs.org)
6
7```bash
8npm i longest --save
9```
10### Install with [bower](https://github.com/bower/bower)
11
12```bash
13bower install longest --save
14```
15
16## Running tests
17Install dev dependencies.
18
19```bash
20npm i -d && npm test
21```
22
23## Usage
24
25```js
26var longest = require('longest');
27longest(['a', 'abcde', 'abc']);
28//=> 'abcde'
29
30longest(['a', 'abcde', 'abc']).length;
31//=> 5
32```
33
34## Related projects
35* [longest-value](https://github.com/jonschlinkert/longest-value): Get the longest value for the given property from an array of objects. Useful for aligning values.
36* [right-align-values](https://github.com/jonschlinkert/right-align-values): Right align the values of a given property for each object in an array. Useful for creating text columns or tables.
37* [right-pad-values](https://github.com/jonschlinkert/right-pad-values): Right pad the values of a given property for each object in an array. Useful for creating text columns or tables.
38* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
39* [pad-right](https://github.com/jonschlinkert/pad-right): Right pad a string with zeros or a specified string. Fastest implementation.
40* [pad-left](https://github.com/jonschlinkert/pad-left): Left pad a string with zeros or a specified string. Fastest implementation.
41
42## Running tests
43Install dev dependencies.
44
45```bash
46npm i -d && npm test
47```
48
49## Contributing
50Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/longest/issues)
51
52## Author
53
54**Jon Schlinkert**
55
56+ [github/jonschlinkert](https://github.com/jonschlinkert)
57+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
58
59## License
60Copyright (c) 2015 Jon Schlinkert
61Released under the MIT license
62
63***
64
65_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 31, 2015._