Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

longest

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

longest

Get the longest item in an array.

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.3M
increased by11.4%
Maintainers
3
Weekly downloads
 
Created

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

Keywords

FAQs

Package last updated on 26 May 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc