# pascalcase

> Convert a string to pascal case (upper camelcase).

Latest version **2.0.0** (published 2021-12-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install pascalcase
pnpm add pascalcase
yarn add pascalcase
bun add pascalcase
```

## Health

**Score 28/100 (F)** — status: abandoned.

Positive: has types package; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-12-29 |
| First published | 2015-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/pascalcase) |
| Module format | ESM + CommonJS |
| Node | >=14 |
| Dependencies | 1 |
| Unpacked size | 8.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | change case, camel, camelcase, case, casing, pascal, pascal-case, pascal case, pascalcase, string, upper camel case, UpperCamelCase |

## Links

- npm: https://www.npmjs.com/package/pascalcase
- Repository: https://github.com/jonschlinkert/pascalcase
- Issues: https://github.com/jonschlinkert/pascalcase/issues
- npm.io page: https://npm.io/package/pascalcase

## Dependencies (1)

- [camelcase](https://npm.io/package/camelcase.md) ^6.2.1

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-12-29
- 1.0.0 — 2019-08-08
- 0.1.1 — 2015-12-04
- 0.1.0 — 2015-08-19

## README

# pascalcase [![NPM version](https://img.shields.io/npm/v/pascalcase.svg?style=flat)](https://www.npmjs.com/package/pascalcase) [![NPM monthly downloads](https://img.shields.io/npm/dm/pascalcase.svg?style=flat)](https://npmjs.org/package/pascalcase) [![NPM total downloads](https://img.shields.io/npm/dt/pascalcase.svg?style=flat)](https://npmjs.org/package/pascalcase)  [![Tests](https://github.com/jonschlinkert/pascalcase/actions/workflows/main.yml/badge.svg)](https://github.com/jonschlinkert/pascalcase/actions/workflows/main.yml)

> Convert a string to pascal case (upper camelcase).

Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.

## Install

Install with [npm](https://www.npmjs.com/) (requires [Node.js](https://nodejs.org/en/) >=14):

```sh
$ npm install --save pascalcase
```

## Prerequisites

Requires [Node.js](https://nodejs.org/en/) version >= 14.

## Usage

```js
import pascalcase from 'pascalcase';
// or the following if you prefer
import { pascalcase } from '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'
```

## Uppercase character sequences

If you wish to preserve upper case character sequences, you may pass an options object with the `preserveConsecutiveUppercase` option set to `true`:

```js
console.log(pascalcase('The IRS Is Mean')); //=> 'TheIrsIsMean
console.log(pascalcase('The IRS Is Mean', { preserveConsecutiveUppercase: true })); //=> TheIRSIsMean

console.log(pascalcase('We saw a UFO')); //=> WeSawAUfo
console.log(pascalcase('We saw a UFO', { preserveConsecutiveUppercase: true })); //=> WeSawAUFO
```

## Options

All options are passed to [sindresorhus/camelcase](https://github.com/sindresorhus/camelcase), please visit that project to learn about all available options.

## About

<details>
<summary><strong>Contributing</strong></summary>

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

</details>

<details>
<summary><strong>Running Tests</strong></summary>

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:

```sh
$ npm install && npm test
```

</details>

<details>
<summary><strong>Building docs</strong></summary>

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

</details>

### Related projects

You might also be interested in these projects:

* [ansi-colors](https://www.npmjs.com/package/ansi-colors): Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in… [more](https://github.com/doowb/ansi-colors) | [homepage](https://github.com/doowb/ansi-colors "Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).")
* [justified](https://www.npmjs.com/package/justified): Wraps words to a specified length and justifies the text in each line. | [homepage](https://github.com/jonschlinkert/justified "Wraps words to a specified length and justifies the text in each line.")
* [randomatic](https://www.npmjs.com/package/randomatic): Generate randomized strings of a specified length using simple character sequences. The original generate-password. | [homepage](https://github.com/jonschlinkert/randomatic "Generate randomized strings of a specified length using simple character sequences. The original generate-password.")
* [word-wrap](https://www.npmjs.com/package/word-wrap): Wrap words to a specified length. | [homepage](https://github.com/jonschlinkert/word-wrap "Wrap words to a specified length.")

### Author

**Jon Schlinkert**

* [GitHub Profile](https://github.com/jonschlinkert)
* [Twitter Profile](https://twitter.com/jonschlinkert)
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)

### License

Copyright © 2021, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on December 29, 2021._

---
_Source: https://npm.io/package/pascalcase · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
