$ npm install lodash-mixin-safename
Get a safe variable name from a given string.
To install the module, run the following in the command line:
npm i lodash-mixin-safename --save
Use within your application with the following line of JavaScript:
var _ = require('lodash');
_.mixin(require('lodash-mixin-safename'));
Type: String
Default value: undefeined
The name to be modified
Type: Array
Default value: []
List of patterns to be removed from the name.
grunt-readme"grunt-readme" => "readme"
var newName = _.safename('grunt-readme');
foo-bar"foo-bar" => "bar"
var newName = _.safename('foo-bar', ['foo']);
Find a bug? Have a feature request? Please create an Issue.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt, and build the documentation with grunt-readme.
Pull requests are also encouraged, and if you find this project useful please consider "starring" it to show your support! Thanks!
Jon Schlinkert
Brian Woodward
Copyright (c) 2014 undefined, contributors. Released under the license
This file was generated by grunt-readme on Thursday, January 2, 2014.