Parse and stringify strings delimited by an underscore
$ npm install --save case-snake
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
MIT © Malte-Maurice Dreyer