Skip to content

Commit

Permalink
Add Node.js 22 recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Apr 25, 2024
1 parent 4d0036f commit a3d7dc5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 19 deletions.
43 changes: 25 additions & 18 deletions README.md
Expand Up @@ -36,23 +36,24 @@ model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"

## Table of Contents

* [Comparison with UUID](#comparison-with-uuid)
* [Benchmark](#benchmark)
* [Security](#security)
* [Install](#install)
* [API](#api)
* [Blocking](#blocking)
* [Non-Secure](#non-secure)
* [Custom Alphabet or Size](#custom-alphabet-or-size)
* [Custom Random Bytes Generator](#custom-random-bytes-generator)
* [Usage](#usage)
* [React](#react)
* [React Native](#react-native)
* [PouchDB and CouchDB](#pouchdb-and-couchdb)
* [Web Workers](#web-workers)
* [CLI](#cli)
* [Other Programming Languages](#other-programming-languages)
* [Tools](#tools)
- [Table of Contents](#table-of-contents)
- [Comparison with UUID](#comparison-with-uuid)
- [Benchmark](#benchmark)
- [Security](#security)
- [Install](#install)
- [API](#api)
- [Blocking](#blocking)
- [Non-Secure](#non-secure)
- [Custom Alphabet or Size](#custom-alphabet-or-size)
- [Custom Random Bytes Generator](#custom-random-bytes-generator)
- [Usage](#usage)
- [React](#react)
- [React Native](#react-native)
- [PouchDB and CouchDB](#pouchdb-and-couchdb)
- [Web Workers](#web-workers)
- [CLI](#cli)
- [Other Programming Languages](#other-programming-languages)
- [Tools](#tools)


## Comparison with UUID
Expand Down Expand Up @@ -132,7 +133,13 @@ npm install nanoid
```

Nano ID 5 works only with ESM projects, in tests or Node.js scripts.
For CommonJS you need Nano ID 3.x (we still support it):
For CommonJS you need to use Node.js 22 with `--experimental-require-module`:

```bash
node --experimental-require-module app.js
```

Or you can use Nano ID 3.x (we still support it):

```bash
npm install nanoid@3
Expand Down
9 changes: 8 additions & 1 deletion README.ru.md
Expand Up @@ -40,6 +40,7 @@ model.id = nanoid() //=> "V1StGXR8_Z5jdHi6B-myT"

## Оглавление

- [Оглавление](#оглавление)
- [Сравнение с UUID](#сравнение-с-uuid)
- [Сравнение производительности](#сравнение-производительности)
- [Безопасность](#безопасность)
Expand Down Expand Up @@ -139,7 +140,13 @@ npm install nanoid
```

Nano ID 5 работает только с ESM-проектами, в тестах или скриптах для Node.js.
Для CommonJS вам нужен Nano ID 3.x (мы ещё всё ещё поддерживаем):
Для CommonJS вам нужна Node.js 22 с флагом `--experimental-require-module`:

```bash
node --experimental-require-module app.js
```

Или возьмите Nano ID 3.x (мы ещё всё ещё поддерживаем):

```bash
npm install nanoid@3
Expand Down

0 comments on commit a3d7dc5

Please sign in to comment.