Add Node.js 22 recommendation
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Andrey Sitnik · committed by Andrey Sitnik · parent 4d0036f · Browse files · 2 files·+33 added−19 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+33 added−19 removed
- other:+33 added−19 removed
Provenance
- Commit
a3d7dc5- Tree
ae0bedf- Author
Andrey Sitnik <andrey@sitnik.ru>- Committer
Andrey Sitnik <andrey@sitnik.ru>- Parent
4d0036f
2 files changed+33 added−19 removed
modified:README.md+25 added-18 removed
34 unmodified lines35 36 37 ## Table of Contents38 39+- [Table of Contents](#table-of-contents)39-* [Comparison with UUID](#comparison-with-uuid)40-* [Benchmark](#benchmark)41-* [Security](#security)42-* [Install](#install)43-* [API](#api)44- * [Blocking](#blocking)45- * [Non-Secure](#non-secure)46- * [Custom Alphabet or Size](#custom-alphabet-or-size)47- * [Custom Random Bytes Generator](#custom-random-bytes-generator)48-* [Usage](#usage)49- * [React](#react)50- * [React Native](#react-native)51- * [PouchDB and CouchDB](#pouchdb-and-couchdb)52- * [Web Workers](#web-workers)53- * [CLI](#cli)54- * [Other Programming Languages](#other-programming-languages)55-* [Tools](#tools)40+- [Comparison with UUID](#comparison-with-uuid)41+- [Benchmark](#benchmark)42+- [Security](#security)43+- [Install](#install)44+- [API](#api)45+ - [Blocking](#blocking)46+ - [Non-Secure](#non-secure)47+ - [Custom Alphabet or Size](#custom-alphabet-or-size)48+ - [Custom Random Bytes Generator](#custom-random-bytes-generator)49+- [Usage](#usage)50+ - [React](#react)51+ - [React Native](#react-native)52+ - [PouchDB and CouchDB](#pouchdb-and-couchdb)53+ - [Web Workers](#web-workers)54+ - [CLI](#cli)55+ - [Other Programming Languages](#other-programming-languages)56+- [Tools](#tools)57 58 59 ## Comparison with UUID60 71 unmodified lines132 npm install nanoid133 ```134 135 Nano ID 5 works only with ESM projects, in tests or Node.js scripts.135-For CommonJS you need Nano ID 3.x (we still support it):136+For CommonJS you need to use Node.js 22 with `--experimental-require-module`:137 138 ```bash139+node --experimental-require-module app.js140+```141+142+Or you can use Nano ID 3.x (we still support it):143+144+```bash145 npm install nanoid@3146 ```147 148 For quick hacks, you can load Nano ID from CDN. Though, it is not recommended304 unmodified linesmodified:README.ru.md+8 added-1 removed
38 unmodified lines39 40 41 ## Оглавление42 43+- [Оглавление](#оглавление)44 - [Сравнение с UUID](#сравнение-с-uuid)45 - [Сравнение производительности](#сравнение-производительности)46 - [Безопасность](#безопасность)47 - [Подключение](#подключение)91 unmodified lines139 npm install nanoid140 ```141 142 Nano ID 5 работает только с ESM-проектами, в тестах или скриптах для Node.js.142-Для CommonJS вам нужен Nano ID 3.x (мы ещё всё ещё поддерживаем):143+Для CommonJS вам нужна Node.js 22 с флагом `--experimental-require-module`:144 145 ```bash146+node --experimental-require-module app.js147+```148+149+Или возьмите Nano ID 3.x (мы ещё всё ещё поддерживаем):150+151+```bash152 npm install nanoid@3153 ```154 155 Для быстрого прототипирования вы можете подключить Nano ID с CDN без установки.275 unmodified lines