@southawu/simple-str-to-snake-case
v1.0.2
Published
A simple library to convert strings to snake_case.
Downloads
1
Readme
simple-str-to-snake-case
A simple library to convert strings to snake_case.
Installation
Install via npm:
npm install simple-str-to-snake-case
Usage
const toSnakeCase = require('simple-str-to-snake-case');
console.log(toSnakeCase('Hello World')); // Output: hello_world
console.log(toSnakeCase('helloWorld')); // Output: hello_world
console.log(toSnakeCase('Hello, World!')); // Output: hello_world
API
toSnakeCase(str)
- str:
string
- The input string to be converted to snake_case. - Returns:
string
- The snake_case version of the input string.