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

Node.js bindings of the convert_case rust library

NotificationsYou must be signed in to change notification settings

Wild-W/convert-case

Repository files navigation

Node.js bindings forconvert_case. This project was created usingneon.

Installing

npm install node-convert-case

Usage

import{Case,Boundary,Pattern,CS}from"node-convert-case";// Using toCaseletmarioTitle:string=CS("super_mario_64").toCase(Case.Title).toString();assert("Super Mario 64"===marioTitle);// Using toCase with the optional argument 'fromCase'marioTitle=CS("super_mario_64").toCase(Case.Title,Case.Lower).toString();assert("Super_mario_64"===marioTitle);// Using isCaseletpascalStr="ExceptionHandler";assert(CS(pascalStr).isCase(Case.Pascal));// Using mutateletcharacterCode:string=CS("567N9854G321K").mutate({boundaries:[Boundary.UpperDigit],delim:"-",pattern:Pattern.Lowercase}).toString();assert("567n-9854g-321k"===characterCode);

The included declaration file has extensive documentation on how to use just about everything included, this is just a quick example. For more examples, check out thetests.

Cases

This is list of cases that node-convert-case supports. Some cases are simply aliases of others.

CaseExample
UpperMY VARIABLE NAME
Lowermy variable name
TitleMy Variable Name
TogglemY vARIABLE nAME
AlternatingmY vArIaBlE nAmE
CamelmyVariableName
PascalMyVariableName
UpperCamelMyVariableName
Snakemy_variable_name
UpperSnakeMY_VARIABLE_NAME
ScreamingSnakeMY_VARIABLE_NAME
Kebabmy-variable-name
CobolMY-VARIABLE-NAME
TrainMy-Variable-Name
Flatmyvariablename
UpperFlatMYVARIABLENAME
RandomMY vaRiabLe nAME
PseudoRandommY VaRiAblE nAMe

Contributing/Modifying

Building node-convert-case requires asupported version of Node and Rust.

First, download this repo's source code, then you can install the project with npm. In the project directory, run:

npm install

This fully installs the project, including installing any dependencies.

To build, run:

npm run build

This command builds and copies the built library into./index.node.

To run tests:

npmtest

Learn More

To learn more about Neon, see theNeon documentation.

To learn more about Rust, see theRust documentation.

To learn more about Node, see theNode documentation.

About

Node.js bindings of the convert_case rust library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp