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

string-analyzer

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-analyzer

A JavaScript package that provides a function to analyze a given string and returns various details about it, such as its length, character count, word count, presence of numbers, special characters, whitespace, and whether it's a palindrome.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

String Analyzer

This JavaScript function, analyzeString(), analyzes a given string and returns various details about it.

Installation

This function does not require any installation. You can simply include it in your JavaScript code.

Functionality

The analyzeString() function takes a string as input and returns an object containing the following details:

  • length: Length of the input string.
  • characterCount: Number of characters in the string.
  • wordCount: Number of words in the string.
  • containsNumbers: Boolean indicating whether the string contains any numeric digits.
  • containsSpecialCharacters: Boolean indicating whether the string contains any special characters.
  • containsWhitespace: Boolean indicating whether the string contains any whitespace characters.
  • isAllUpperCase: Boolean indicating whether the string is entirely uppercase.
  • isAllLowerCase: Boolean indicating whether the string is entirely lowercase.
  • isPalindrome: Boolean indicating whether the string is a palindrome (reads the same forwards and backwards).

Example

Input

javascript
const input = "A man, a plan, a canal, Panama!";
const stringDetails = analyzeString(input);

Expected Output

json
{
  "length": 30,
  "characterCount": 27,
  "wordCount": 6,
  "containsNumbers": false,
  "containsSpecialCharacters": true,
  "containsWhitespace": true,
  "isAllUpperCase": false,
  "isAllLowerCase": false,
  "isPalindrome": true}

FAQs

Package last updated on 06 Feb 2024

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