26

Naming convention transfer

 4 years ago
source link: https://github.com/TroyTae/naming-convention-transfer
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Naming Convention Transfer

Change your naming convention freely!

Installation

npm (commonjs)

npm install naming-convention-transfer

browser (iife)

Please download this file.

And embed script tag in your document.

<script src="./dist/naming-convention-transfer.js"></script>

Example

Nodejs

import { pascalToSnake } from 'naming-convention-transfer';

pascalToSnake('NamingConventionTransfer') === 'naming_convention_transfer';

Browser

NamingConventionTransfer.camelToKebab('namingConventionTransfer') === 'naming-convention-transfer';

API

Name Description kebabToSnake Transfer from kebab-case to snake_case kebabToCamel Transfer from kebab-case to camelCase kebabToPascal Transfer from kebab-case to PascalCase snakeToKebab Transfer from snake_case to kebab-case snakeToCamel Transfer from snake_case to camelCase snakeToPascal Transfer from snake_case to PascalCase camelToPascal Transfer from camelCase to PascalCase camelToKebab Transfer from camelCase to kebab-case camelToSnake Transfer from camelCase to snake_case pascalToCamel Transfer from PascalCase to camelCase pascalToKebab Transfer from PascalCase to kebab-case pascalToSnake Transfer from PascalCase to snake_case

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK