varlidator
v2.0.5
Published
JavaScript variable identifier validation.
Downloads
9
Readme
Varlidator
JavaScript variable identifier validation. Try/Catch a new Function() which defines and returns a Boolean to a variable name.
JSPerf comparsion between valid and invalid variable names.
http://jsperf.com/varlidator-valid-vs-invalid
Install
npm install varlidator --save
Usage
var varlidate = require('varlidator');
var isValid = varlidate('@');
// returns: false
isValid = varlidate('a');
// returns: true
How to develop
npm install
grunt
How to build (before publishing)
npm install
grunt build
Alternatives
- https://github.com/mathiasbynens/mothereff.in/tree/master/js-variables