Socket
Socket
Sign inDemoInstall

pascal-case

Package Overview
Dependencies
1
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pascal-case

Transform into a string of capitalized words without separators


Version published
Weekly downloads
15M
Maintainers
1
Install size
11.7 kB
Created
Weekly downloads
 

Package description

What is pascal-case?

The pascal-case npm package is used to convert strings into PascalCase format, where the first letter of each word is capitalized and all words are concatenated without spaces. This is often used in programming to name classes, types, and other identifiers that require this specific casing convention.

What are pascal-case's main functionalities?

Convert string to PascalCase

This feature takes a string and converts it to PascalCase. The given code sample demonstrates how you might manually convert a string to PascalCase by splitting it into words, capitalizing the first letter of each word, and then joining them together without spaces.

"hello world".split(' ').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join('')

Other packages similar to pascal-case

Readme

Source

Pascal Case

Transform into a string of capitalized words without separators.

Installation

npm install pascal-case --save

Usage

import { pascalCase } from "pascal-case";

pascalCase("string"); //=> "String"
pascalCase("dot.case"); //=> "DotCase"
pascalCase("PascalCase"); //=> "PascalCase"
pascalCase("version 1.2.10"); //=> "Version_1_2_10"

The function also accepts options.

Merge Numbers

If you'd like to remove the behavior prefixing _ before numbers, you can use pascalCaseTransformMerge:

import { pascalCaseTransformMerge } from "pascal-case";

pascalCase("version 12", { transform: pascalCaseTransformMerge }); //=> "Version12"

License

MIT

Keywords

FAQs

Last updated on 30 Sep 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