Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Get a safe variable name from a given string.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
docs
test
.editorconfig
.gitignore
.jshintrc
.npmignore
Gruntfile.js
LICENSE-MIT
README.md
bower.json
index.js
package.json

README.md

lodash-mixin-safename NPM version

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.

Something went wrong with that request. Please try again.