epic-case-converter
v1.0.1
Published
Convert variable names in your code across different programming languages.
Downloads
8
Readme
Case Convert
A JS library to convert variable names in your code across different programming languages.
Instructions
- Install the library using
npm i epic-case-converter - Require the library in your file:
const convertCase = require('epic-case-converter) - Call the function and pass in two arguments: the variable you want to convert and the case you want to convert it to (all cases outlined below). For example, if you call
convertCase('MyVariableName', 'kebab')it will return the stringmy-variable-name
Camel Case:
Programs: JavaScript, Java, C#, Swift
Example: myVariableName
Pascal Case (Upper Camel Case):
Programs: C#, Swift
Example: MyVariableName
Snake Case:
Programs: Python, Ruby
Example: my_variable_name
Kebab Case (Hyphen Case):
Programs: CSS, HTML, URL slugs
Example: my-variable-name
Train Case (Title Case):
Programs: Pascal, Erlang
Example: My-Variable-Name
Screaming Snake Case (Upper Snake Case):
Programs: Python (for constants)
Example: MY_VARIABLE_NAME
Upper Case:
Programs: C, C++, PHP
Example: MYVARIABLENAME
Lower Case:
Programs: C, C++, PHP
Example: myvariablename
