Socket
Socket
Sign inDemoInstall

epic-case-converter

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    epic-case-converter

Convert variable names in your code across different programming languages.


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Case Convert

A JS library to convert variable names in your code across different programming languages.

Instructions

  1. Install the library using npm i epic-case-converter
  2. Require the library in your file: const convertCase = require('epic-case-converter)
  3. 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 string my-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

* LIIMITATIONS: The library cannot convert from Upper Case or Lower Case (C, C++, PHP) since there is no way to parse the words in the variable. It can convert to these cases though.

FAQs

Last updated on 02 Jul 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc