{"_id":"is-identifier","_rev":"4443572","name":"is-identifier","description":"Check if a string is a valid JavaScript identifier","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-04-08T14:15:19.000Z","created":"2024-05-05T18:22:33.908Z","1.0.1":"2024-07-12T12:14:39.962Z","1.0.0":"2024-05-05T18:22:33.908Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-identifier.git"},"versions":{"1.0.1":{"name":"is-identifier","version":"1.0.1","description":"Check if a string is a valid JavaScript identifier","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-identifier.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava"},"keywords":["identifier","keyword","word","check","test","reserved","javascript","ecmascript","variable","function","property","is","valid"],"dependencies":{"identifier-regex":"^1.0.0","super-regex":"^1.0.0"},"devDependencies":{"ava":"^6.1.2","xo":"^0.58.0"},"_id":"is-identifier@1.0.1","gitHead":"c97b5573e3a895b18542356ee8b411c1ae68e2f0","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/is-identifier/issues"},"homepage":"https://github.com/sindresorhus/is-identifier#readme","_nodeVersion":"18.20.2","_npmVersion":"10.6.0","dist":{"shasum":"76d66e7813e37cc85cc8263f04eaa558d1a5d2dc","size":1969,"noattachment":false,"key":"/is-identifier/-/is-identifier-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-identifier/download/is-identifier-1.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-identifier_1.0.1_1720786479821_0.8746479581924771"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-07-12T12:14:39.962Z","publish_time":1720786479962,"_source_registry_name":"default","_cnpm_publish_time":1720786479962},"1.0.0":{"name":"is-identifier","version":"1.0.0","description":"Check if a string is a valid JavaScript identifier","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-identifier.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava"},"keywords":["identifier","keyword","word","check","test","reserved","javascript","ecmascript","variable","function","property","is","valid"],"dependencies":{"identifier-regex":"^1.0.0","super-regex":"^1.0.0"},"devDependencies":{"ava":"^6.1.2","xo":"^0.58.0"},"_id":"is-identifier@1.0.0","gitHead":"f1222ac0a28b04d91d0e83bd25a08c8bbde0968d","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/is-identifier/issues"},"homepage":"https://github.com/sindresorhus/is-identifier#readme","_nodeVersion":"20.12.2","_npmVersion":"10.6.0","dist":{"shasum":"58b6b07a53c633151fa65531d8fa9c6eb6af31a4","size":1971,"noattachment":false,"key":"/is-identifier/-/is-identifier-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-identifier/download/is-identifier-1.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-identifier_1.0.0_1714933353768_0.8621861292298842"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-05-05T18:22:33.908Z","publish_time":1714933353908,"_source_registry_name":"default","_cnpm_publish_time":1714933353908}},"readme":"# is-identifier\n\n> Check if a string is a valid [JavaScript identifier](https://developer.mozilla.org/en-US/docs/Glossary/Identifier)\n\n## Install\n\n```sh\nnpm install is-identifier\n```\n\n## Usage\n\n```js\nimport isIdentifier from 'is-identifier';\n\nisIdentifier('foo');\n//=> true\n\nisIdentifier('1kg');\n//=> false\n\nisIdentifier('await'); // Reserved identifier\n//=> false\n```\n\n> [!NOTE]\n> Although `globalThis`, `Infinity`, `NaN`, and `undefined` are [properties of the global object](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object) and not identifiers, they are treated as reserved here because they should generally not be used as identifiers.\n\n## API\n\n### isIdentifier(value)\n\nReturns a boolean for whether the given value is a valid JavaScript identifier.\n\n## Related\n\n- [to-valid-identifier](https://github.com/sindresorhus/to-valid-identifier) - Convert a string to a valid JavaScript identifier\n- [identifier-regex](https://github.com/sindresorhus/identifier-regex) - Regular expression for matching valid JavaScript identifiers\n- [reserved-identifiers](https://github.com/sindresorhus/reserved-identifiers) - Provides a list of reserved identifiers for JavaScript\n","_attachments":{},"homepage":"https://github.com/sindresorhus/is-identifier#readme","bugs":{"url":"https://github.com/sindresorhus/is-identifier/issues"},"license":"MIT"}