Socket
Socket
Sign inDemoInstall

pascal-case

Package Overview
Dependencies
1
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

pascal-case

Transform into a string of capitalized words without separators

    4.0.0latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
12,824,029
decreased by-14.96%

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 installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the 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