Skip to content

Commit a456c40

Browse files
committed
Fix Install guide
1 parent f4cf2bc commit a456c40

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

README.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,11 @@ Test configuration: Framework 13 7840U, Fedora 39, Node.js 21.6.
132132
npm install nanoid
133133
```
134134

135-
Nano ID 5 works only with ESM projects, in tests or Node.js scripts.
136-
For CommonJS you need to use latest Node.js 20 or 22
137-
with `--experimental-require-module`:
135+
Nano ID 5 works with ESM projects (with `import`) in tests or Node.js scripts.
136+
For CommonJS `require()` you need to use latest Node.js 22.12
137+
(works out-of-the-box) or Node.js 20 (with `--experimental-require-module`):
138138

139-
```bash
140-
node --experimental-require-module app.js
141-
```
142-
143-
Or you can use Nano ID 3.x (we still support it):
139+
For Node.js 18 you can use Nano ID 3.x (we still support it):
144140

145141
```bash
146142
npm install nanoid@3

README.ru.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,11 @@ _См. также хорошую статью о теориях генерато
139139
npm install nanoid
140140
```
141141

142-
Nano ID 5 работает только с ESM-проектами, в тестах или скриптах для Node.js.
143-
Для CommonJS вам нужна последняя версия Node.js 20 или 22
144-
с флагом `--experimental-require-module`:
142+
Nano ID 5 работает с ESM-проектами (`import`) в тестах или скриптах для Node.js.
143+
Для CommonJS `require()` вам нужна последняя версия Node.js 22.12
144+
(работает из коробки) или Node.js 20 (с флагом `--experimental-require-module`):
145145

146-
```bash
147-
node --experimental-require-module app.js
148-
```
149-
150-
Или возьмите Nano ID 3.x (мы его всё ещё поддерживаем):
146+
Для Node.js 18 возьмите Nano ID 3.x (мы его всё ещё поддерживаем):
151147

152148
```bash
153149
npm install nanoid@3

0 commit comments

Comments
 (0)