Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Convert a string to pascal case (upper camel case). Used by more than 8.7 million projects on GitHub! Please follow this library's author:https://github.com/jonschlinkert

License

NotificationsYou must be signed in to change notification settings

jonschlinkert/pascalcase

Repository files navigation

Convert a string to pascal case (upper camelcase).

Please consider following this project's author,Jon Schlinkert, and consider starring the project to show your ❤️ and support.

Install

Install withnpm (requiresNode.js >=14):

$ npm install --save pascalcase

Prerequisites

RequiresNode.js version >= 14.

Usage

importpascalcasefrom'pascalcase';// or the following if you preferimport{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 thepreserveConsecutiveUppercase option set totrue:

console.log(pascalcase('The IRS Is Mean'));//=> 'TheIrsIsMeanconsole.log(pascalcase('The IRS Is Mean',{preserveConsecutiveUppercase:true}));//=> TheIRSIsMeanconsole.log(pascalcase('We saw a UFO'));//=> WeSawAUfoconsole.log(pascalcase('We saw a UFO',{preserveConsecutiveUppercase:true}));//=> WeSawAUFO

Options

All options are passed tosindresorhus/camelcase, please visit that project to learn about all available options.

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests,please create an issue.

Running Tests

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&& npmtest
Building docs

(This project's readme.md is generated byverb, 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

Related projects

You might also be interested in these projects:

  • ansi-colors: Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in…more |homepage
  • justified: Wraps words to a specified length and justifies the text in each line. |homepage
  • randomatic: Generate randomized strings of a specified length using simple character sequences. The original generate-password. |homepage
  • word-wrap: Wrap words to a specified length. |homepage

Author

Jon Schlinkert

License

Copyright © 2021,Jon Schlinkert.Released under theMIT License.


This file was generated byverb-generate-readme, v0.8.0, on December 29, 2021.

About

Convert a string to pascal case (upper camel case). Used by more than 8.7 million projects on GitHub! Please follow this library's author:https://github.com/jonschlinkert

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp