npm

Check out our latest tech talk, "JavaScript Supply Chain Security" presented by VP of Security, Adam Baldwin.Watch it here »

is-reserved

0.0.11 • Public • Published

is it a reserved keyword ?

If your're wondering if some name is reserved in Javascript, make it sure by checking it out with is-reserved. It supports from ECMASCript 1 until ECMAScript 6 and even the ECMAScript 7 draft.

Installation

$ npm install is-reserved
# or set it up globally 
$ npm install is-reserved --global

Command line

is-reserved was made to run right away from your terminal

$ is-reserved delete

You may specify the ECMAScript version with the option --es

$ is-reserved delete --es6

For other options, just type $ is-reserved help

Usage

It is also possible to use it programatically:

import isReserved from 'is-reserved';
 
console.log('is delete reserved on latest ECMAScript Version?', isReserved.check('delete'));
console.log('is delete reserved on ES6?', isReserved.check('delete', isReserved.ES6));
console.log('is delete reserved on ES2?', isReserved.check('delete', isReserved.ES2));
 
// List all reserved keywords for ES5
console.log(isReserved.keywords[isReserved.ES5]);
 

Test

npm run test

License

MIT

install

npm i is-reserved

Downloadsweekly downloads

10

version

0.0.11

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability