A JS library to convert variable names in your code across different programming languages.
- 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
Programs: JavaScript, Java, C#, Swift
Example: myVariableName
Programs: C#, Swift
Example: MyVariableName
Programs: Python, Ruby
Example: my_variable_name
Programs: CSS, HTML, URL slugs
Example: my-variable-name
Programs: Pascal, Erlang
Example: My-Variable-Name
Programs: Python (for constants)
Example: MY_VARIABLE_NAME
Programs: C, C++, PHP
Example: MYVARIABLENAME
Programs: C, C++, PHP
Example: myvariablename