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

longest

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

longest

Get the length of the longest item in an array.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
995K
decreased by-63.56%
Maintainers
1
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

FAQs

Package last updated on 28 Mar 2014

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