Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
The pascalcase npm package is a simple utility that converts strings into PascalCase format. This can be useful for formatting variable names, class names, or other identifiers in programming to adhere to PascalCase naming conventions.
String Conversion to PascalCase
Converts a given string to PascalCase by splitting the string into words, capitalizing the first letter of each word, and then concatenating them without spaces.
"hello world".split(' ').map(w => w.charAt(0).toUpperCase() + w.slice(1)).join('')
The camelcase package converts strings to camelCase format. It is similar to pascalcase but the first letter of the resulting string is lowercase, which is the main difference between camelCase and PascalCase.
This is a more comprehensive string transformation library that includes various case conversion methods including pascalCase, camelCase, snake_case, and more. It offers more functionality compared to the single-purpose pascalcase package.
Similar to pascalcase, uppercamelcase converts strings to UpperCamelCase (another name for PascalCase). The functionality is very similar, but the package names suggest a different naming convention for the same string transformation.
Convert a string to pascal-case.
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.
Install with npm (requires Node.js >=8):
$ npm install --save pascalcase
const pascalcase = require('pascalcase');
console.log(pascalcase('a')); //=> 'A'
console.log(pascalcase('foo bar baz')); //=> 'FooBarBaz'
console.log(pascalcase(' foo bar baz ')); //=> 'FooBarBaz'
console.log(pascalcase('foo_bar-baz')); //=> 'FooBarBaz'
console.log(pascalcase('foo.bar.baz')); //=> 'FooBarBaz'
console.log(pascalcase('foo/bar/baz')); //=> 'FooBarBaz'
console.log(pascalcase('foo[bar)baz')); //=> 'FooBarBaz'
console.log(pascalcase('#foo+bar*baz')); //=> 'FooBarBaz'
console.log(pascalcase('$foo~bar`baz')); //=> 'FooBarBaz'
console.log(pascalcase('_foo_bar-baz-')); //=> 'FooBarBaz'
console.log(pascalcase('foo 2 bar 5 baz')); //=> 'Foo2Bar5Baz'
console.log(pascalcase('foo2bar5baz')); //=> 'Foo2bar5baz'
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
You might also be interested in these projects:
Jon Schlinkert
Copyright © 2019, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.8.0, on August 08, 2019.
FAQs
Convert a string to pascal case (upper camelcase).
The npm package pascalcase receives a total of 6,610,793 weekly downloads. As such, pascalcase popularity was classified as popular.
We found that pascalcase demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.