lodash-mixin-safename
v0.0.0
Published
Get a safe variable name from a given string.
Downloads
2
Readme
lodash-mixin-safename
Get a safe variable name from a given string.
Getting Started
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'));
Options
name
Type: String
Default value: undefeined
The name to be modified
patterns
Type: Array
Default value: []
List of patterns to be removed from the name.
Usage Examples
Example grunt-readme
"grunt-readme" => "readme"
var newName = _.safename('grunt-readme');
Example foo-bar
"foo-bar" => "bar"
var newName = _.safename('foo-bar', ['foo']);
Contributing
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!
Author
Jon Schlinkert
Brian Woodward
Related
- helpers: some great handlebars helpers that we decided not to include in the handlebars-helpers project, most likely because the code footprint was too big or the helper wasn't generic enough.
License
Copyright (c) 2014 undefined, contributors. Released under the license
This file was generated by grunt-readme on Thursday, January 2, 2014.