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

string-case

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-case

A Node.js module offering various string manipulation functions for capitalization, initial capitalization of words, and specific casing of text.

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
45
increased by350%
Maintainers
1
Weekly downloads
 
Created
Source

String Manipulation Functions

A Node.js module providing various string manipulation functions to handle capitalization and text formatting.

Installation

Install the package via npm:

npm install string-case --save

Usage

const {
  capitalize,
  initCap,
  capitalizeAndLowerCaseAllTheOthers,
  initCapAndLowerCaseAllTheOthers,
} = require("string-case");

// Capitalize the first letter of a string
const capitalizedString = capitalize("hello"); // Output: 'Hello'

// Capitalize the first letter of each word in a string
const initCapitalizedString = initCap("hello world"); // Output: 'Hello World'

// Capitalize the first letter and lowercase the rest of the string
const modifiedString = capitalizeAndLowerCaseAllTheOthers("HeLlO"); // Output: 'Hello'

// Capitalize the first letter of each word and lowercase the rest of the string
const modifiedString = initCapAndLowerCaseAllTheOthers("HeLlO woRlD"); // Output: 'Hello World'

These functions provide various ways to manipulate strings, allowing for capitalization, initial capitalization of words, and specific casing of text based on your requirements.

Feel free to integrate these functions into your Node.js projects to handle string manipulations efficiently.

Keywords

FAQs

Package last updated on 11 Dec 2023

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