Skip to content
Myr

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

2 files+33 added−19 removed

modified:README.md+25 added-18 removed
34 unmodified lines
353637## Table of Contents3839- [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)575859## Comparison with UUID60
71 unmodified lines
132npm install nanoid133```134135Nano ID 5 works only with ESM projects, in tests or Node.js scripts.135For CommonJS you need Nano ID 3.x (we still support it):136For CommonJS you need to use Node.js 22 with `--experimental-require-module`:137138```bash139node --experimental-require-module app.js140```141142Or you can use Nano ID 3.x (we still support it):143144```bash145npm install nanoid@3146```147148For quick hacks, you can load Nano ID from CDN. Though, it is not recommended
304 unmodified lines
modified:README.ru.md+8 added-1 removed
38 unmodified lines
394041## Оглавление4243- [Оглавление](#оглавление)44- [Сравнение с UUID](#сравнение-с-uuid)45- [Сравнение производительности](#сравнение-производительности)46- [Безопасность](#безопасность)47- [Подключение](#подключение)
91 unmodified lines
139npm install nanoid140```141142Nano ID 5 работает только с ESM-проектами, в тестах или скриптах для Node.js.142Для CommonJS вам нужен Nano ID 3.x (мы ещё всё ещё поддерживаем):143Для CommonJS вам нужна Node.js 22 с флагом `--experimental-require-module`:144145```bash146node --experimental-require-module app.js147```148149Или возьмите Nano ID 3.x (мы ещё всё ещё поддерживаем):150151```bash152npm install nanoid@3153```154155Для быстрого прототипирования вы можете подключить Nano ID с CDN без установки.
275 unmodified lines