/case-snake

Parse and stringify strings delimited by an underscore

Primary LanguageJavaScriptMIT LicenseMIT

case-snake NPM version Build Status Dependency Status Coverage percentage

Parse and stringify strings delimited by an underscore

Installation

$ npm install --save case-snake

Usage

const caseSnake = require("case-snake");

// Parse
caseSnake.parse("this_is_an_example"); // ['this', 'is', 'an', 'example']

// Stringify
caseSnake.stringify(["this", "is", "an", "example"]); // 'this_is_an_example'

// Check
caseSnake.is("this_is_an_example"); // True
caseSnake.is("this-is-an-example"); // False
caseSnake.is("thisIsAnExample"); // False
caseSnake.is("this"); // False

License

MIT © Malte-Maurice Dreyer