Socket
Socket
Sign inDemoInstall

string-case

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

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.


Version published
Weekly downloads
67
decreased by-2.9%
Maintainers
1
Install size
5.91 kB
Created
Weekly downloads
 

Readme

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

Last updated on 11 Dec 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc