Socket
Socket
Sign inDemoInstall

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.


Version published
Weekly downloads
2.2M
decreased by-15.21%
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