Socket
Socket
Sign inDemoInstall

longest

Package Overview
Dependencies
0
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    longest

Get the longest item in an array.


Version published
Weekly downloads
3M
increased by1.69%
Maintainers
3
Install size
6.07 kB
Created
Weekly downloads
 

Package description

What is longest?

The 'longest' npm package is a simple utility that allows you to find the longest string in an array of strings. It is useful when you need to determine the maximum length of strings within a collection, which can be helpful for formatting console output, aligning text, or any other situation where string length matters.

What are longest's main functionalities?

Find the longest string in an array

This feature allows you to pass an array of strings to the 'longest' function, which returns the longest string in the array.

"const longest = require('longest');
const array = ['short', 'medium', 'longestString'];
const longestString = longest(array);
console.log(longestString); // 'longestString'"

Other packages similar to longest

Readme

Source

longest NPM version NPM monthly downloads NPM total downloads Linux Build Status

Get the longest item in an array.

Install

Install with npm:

$ npm install --save longest

Install

Install with bower

$ bower install longest --save

Usage

var longest = require('longest');
longest(['a', 'abcde', 'abc']);
//=> 'abcde'

longest(['a', 'abcde', 'abc']).length;
//=> 5

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Contributors

CommitsContributor
25jonschlinkert
4shinnn
1kevva
1kemitchell

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.6.0, on May 26, 2017.

Keywords

FAQs

Last updated on 26 May 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc