Socket
Socket
Sign inDemoInstall

sentence-case

Package Overview
Dependencies
4
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sentence-case

Transform into a lower case with spaces between words, then capitalize the string


Version published
Weekly downloads
6.4M
increased by5.7%
Maintainers
1
Install size
101 kB
Created
Weekly downloads
 

Package description

What is sentence-case?

The sentence-case npm package is designed to convert strings to sentence case, where the first letter of the sentence is capitalized and all other letters are in lower case. This is useful for formatting text to adhere to grammatical rules in English and other languages that follow similar capitalization rules.

What are sentence-case's main functionalities?

Convert string to sentence case

This feature allows you to convert any given string to sentence case. It also supports locale-based transformations, which can be useful for languages with specific casing rules.

const sentenceCase = require('sentence-case');

const result = sentenceCase('string'); // 'String'
const resultWithLocale = sentenceCase('STRING', 'tr'); // 'Strıng' with Turkish locale

Other packages similar to sentence-case

Readme

Source

Sentence Case

NPM version NPM downloads Bundle size

Transform into a lower case with spaces between words, then capitalize the string.

Installation

npm install sentence-case --save

Usage

import { sentenceCase } from "sentence-case";

sentenceCase("string"); //=> "String"
sentenceCase("dot.case"); //=> "Dot case"
sentenceCase("PascalCase"); //=> "Pascal case"
sentenceCase("version 1.2.10"); //=> "Version 1 2 10"

The function also accepts options.

License

MIT

Keywords

FAQs

Last updated on 02 Dec 2020

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