is-valid-variable

1.0.1 • Public • Published

is-valid-variable

Check if a token is a valid variable name

npm install is-valid-property

Doesn't try to follow the full spec, ie might say false when something should be true, but will never say true when something should be false

Usage

const isValidVariable = require('is-valid-variable')

console.log(isValidVariable('const')) // false
console.log(isValidVariable('constantin')) // true
console.log(isValidVariable('64')) // false
console.log(isValidVariable('x64')) // true

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i is-valid-variable

Weekly Downloads

125

Version

1.0.1

License

MIT

Unpacked Size

3.95 kB

Total Files

6

Last publish

Collaborators

  • mafintosh