# reserved-identifiers

> Provides a list of reserved identifiers for JavaScript

Latest version **1.2.0** (published 2025-10-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install reserved-identifiers
pnpm add reserved-identifiers
yarn add reserved-identifiers
bun add reserved-identifiers
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2025-10-25 |
| First published | 2024-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | reserved, identifiers, keywords, words, restricted, javascript, ecmascript, identifier, variable, function, property, set |

## Links

- npm: https://www.npmjs.com/package/reserved-identifiers
- Repository: https://github.com/sindresorhus/reserved-identifiers
- Homepage: https://github.com/sindresorhus/reserved-identifiers#readme
- Issues: https://github.com/sindresorhus/reserved-identifiers/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/reserved-identifiers

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2025-10-25
- 1.1.0 — 2025-10-24
- 1.0.0 — 2024-05-05

## README

# reserved-identifiers

> Provides a list of [reserved identifiers](https://262.ecma-international.org/14.0/#sec-keywords-and-reserved-words) for JavaScript

It assumes the latest JavaScript version (ES2023) and module context. Supporting older JavaScript versions is a non-goal.

## Install

```sh
npm install reserved-identifiers
```

## Usage

```js
import reservedIdentifiers from 'reserved-identifiers';

const identifiers = reservedIdentifiers();
const isReserved = identifier => identifiers.has(identifier);

console.log(isReserved('await'));
//=> true
```

## API

### reservedIdentifiers(options?)

Returns a `Set` with the identifiers.

#### options

Type: `object`

##### includeGlobalProperties

Type: `boolean`\
Default: `false`

Include the [global properties](https://tc39.es/ecma262/#sec-value-properties-of-the-global-object) `globalThis`, `Infinity`, `NaN`, and `undefined`. Although not officially reserved, they should typically [not be used as identifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined#sect1).

### typeScriptReservedTypes()

Returns a `Set` with TypeScript's built-in types that are reserved and cannot be used for type names (interfaces, type aliases, enums, classes, type parameters).

```js
import {typeScriptReservedTypes} from 'reserved-identifiers';

const types = typeScriptReservedTypes();

console.log(types.has('any'));
//=> true

console.log(types.has('unknown'));
//=> true
```

## Related

- [is-identifier](https://github.com/sindresorhus/is-identifier) - Check if a string is a valid JavaScript identifier

---
_Source: https://npm.io/package/reserved-identifiers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
