node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey ยป



npm install valid-identifier

var validateIdentifier = require('valid-identifier');
validateIdentifier("$dollarSign"); // returns true
validateIdentifier("org.apache.cordova.myapp"); // true

validateIdentifier(""); // false, private is a reserved word
validateIdentifier("org.8bit"); // false, portion starts with a number
validateIdentifier(""); // false

Running the tests

npm test