Socket
Socket
Sign inDemoInstall

longest-streak

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

longest-streak

Count the longest repeating streak of a character


Version published
Weekly downloads
6.2M
increased by6.03%
Maintainers
1
Weekly downloads
 
Created

What is longest-streak?

The 'longest-streak' npm package is designed to calculate the longest streak of consecutive characters in a given string. It is useful for analyzing text patterns, such as finding the most repeated character in a row in a text.

What are longest-streak's main functionalities?

Calculate longest consecutive character streak

This feature allows you to determine the length of the longest sequence of a repeated character in a string. In the provided code sample, the function returns '10' because the character 'e' repeats consecutively ten times, which is the longest streak in the string.

const longestStreak = require('longest-streak');
console.log(longestStreak('aaaabbaaccdeeeeeeeeee')); // Output: 10
0

Keywords

FAQs

Package last updated on 08 Nov 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