https://github.com/yerkopalma/is-valid-identifier
:v: check if a string is a valid ECMAscript identifier
https://github.com/yerkopalma/is-valid-identifier
identifier
Last synced: 3 months ago
JSON representation
:v: check if a string is a valid ECMAscript identifier
- Host: GitHub
- URL: https://github.com/yerkopalma/is-valid-identifier
- Owner: YerkoPalma
- License: mit
- Created: 2016-09-29T14:56:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-19T20:52:41.000Z (about 6 years ago)
- Last Synced: 2025-03-01T14:22:59.496Z (3 months ago)
- Topics: identifier
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/is-valid-identifier
- Size: 20.5 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# is-valid-identifier [](https://travis-ci.org/YerkoPalma/is-valid-identifier) [](https://github.com/feross/standard)
> check if a string is a valid ECMAscript identifier
All the code is based on [this repo](https://github.com/mathiasbynens/mothereff.in/tree/master/js-variables), I am just putting it into npm.
## Installation
```bash
npm install --save is-valid-identifier
```## Usage
```javascript
const isValidIdentifier = require('is-valid-identifier')isValidIdentifier('404') // => false
isValidIdentifier('404', true) // => second argument is for strict mode, instead of returning a false, will throw an exception
```## License
MIT
Crafted with <3 by [Yerko Palma](https://github.com/YerkoPalma).
***
> This package was initially generated with [yeoman](http://yeoman.io) and the [p generator](https://github.com/johnotander/generator-p.git).