Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/modules/bluebird-q.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ description: Modern alternatives to the Bluebird and Q Promise libraries for asy

[`bluebird`](https://github.com/petkaantonov/bluebird?tab=readme-ov-file#%EF%B8%8Fnote%EF%B8%8F) and [`q`](https://github.com/kriskowal/q#note) recommend switching away from them to native promises.

## NativeBird
## `nativebird`

[`NativeBird`](https://github.com/doodlewind/nativebird) is an ultralight native `Promise` extension that provides Bluebird-like helpers if you miss a few conveniences from Bluebird.
2 changes: 1 addition & 1 deletion docs/modules/builtin-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Native Node.js alternatives to the builtin-modules package for list

# Replacements for `builtin-modules`

## Node.js (since 6.x)
## `builtinModules` (native, since Node.js 6.x)

For getting the list of built-in modules, you can use [builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules):

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/core-util-is.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Native Node.js alternatives to the core-util-is package

# Replacements for `core-util-is`

## Node.js util
## `util.types` (native, Node.js)

[`util.types`](https://nodejs.org/api/util.html#utiltypes) is an official, cross‑realm type checks for built-in objects (Date, RegExp, Error, typed arrays, etc.)

Expand All @@ -16,4 +16,4 @@ import { types } from 'node:util' // [!code ++]

const isDate = cui.isDate(value) // [!code --]
const isDate = types.isDate(value) // [!code ++]
```
```
2 changes: 1 addition & 1 deletion docs/modules/crypto-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Modern alternatives to the `crypto-js` package for cryptographic op

`crypto-js` is no longer actively maintained and has been discontinued since engines now come with this functionality built-in.

## Node `node:crypto` (built-in)
## `node:crypto` (native, Node.js built-in)

Node provides a [`node:crypto`](https://nodejs.org/api/crypto.html) module as part of its standard library.

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/dot-prop.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Modern alternatives to the dot-prop package for getting, setting, a

# Replacements for `dot-prop`

## `dlv` + `dset`
## `dlv` and `dset`

[`dlv`](https://github.com/developit/dlv) gets nested values with default fallbacks and [`dset`](https://github.com/lukeed/dset) sets nested values with automatic intermediate object creation.

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/dotenv.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Modern alternatives to the dotenv package for loading and managing

Although dotenv is reliable, it may not be necessary or may lack certain features.

## Node.js --env-file / --env-file-if-exists
## `--env-file` / `--env-file-if-exists` (native, Node.js)

Built into Node.js (v20.6.0+; v22.9.0 for `--env-file-if-exists`). Zero dependencies—perfect for most apps that just need to load a `.env` at startup.

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Shared alternatives and examples for fetch based HTTP clients used

This page contains the common, recommended alternatives and examples for fetch based HTTP clients used by `axios`, `node-fetch`, and `cross-fetch` replacement docs.

## Native `fetch` API
## `fetch` API (native)

The native [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) API is available in Node.js (since v18.x) and all modern browsers. For many use cases it replaces `axios`/`node-fetch`/`cross-fetch` without adding dependencies.

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/is-builtin-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Native Node.js alternatives to the is-builtin-module package for ch

# Replacements for `is-builtin-module`

## Node.js (since 16.x)
## `isBuiltin` (native, since Node.js 16.x)

For determining if a module is built-in or not, you can use [isBuiltin](https://nodejs.org/api/module.html#moduleisbuiltinmodulename):

Expand All @@ -16,7 +16,7 @@ isBuiltin('fs') // true [!code ++]
isBuiltinModule('fs') // true [!code --]
```

## Node.js 6.x to 15.x
## `builtInModules` (native, since Node.js 6.x and 15.x)

Before Node.js 16.x, `isBuiltin` was not available, so you need to implement your own check using [builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules):

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/mkdirp.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Modern alternatives to the mkdirp and make-dir packages for recursi

# Replacements for `mkdirp` / `make-dir`

## Node.js (since v10.12.0)
## Recursive `fs.mkdir` (native, since Node.js v10.12.0)

Node.js v10.12.0 and up supports the `recursive` option in the [`fs.mkdir`](https://nodejs.org/api/fs.html#fsmkdirpath-options-callback) function, which allows parent directories to be created automatically.

Expand Down
6 changes: 3 additions & 3 deletions docs/modules/moment.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Modern alternatives to moment.js for date manipulation and formatti

# Replacements for `Moment.js`

## `Day.js`
## `day.js`

[Day.js](https://github.com/iamkun/dayjs/) provides a similar API to Moment.js with a much smaller footprint.

Expand Down Expand Up @@ -41,7 +41,7 @@ const lastWeek = moment().subtract(1, 'week') // [!code --]
const lastWeek = subWeeks(new Date(), 1) // [!code ++]
```

## `Luxon`
## `luxon`

[Luxon](https://github.com/moment/luxon) is created by a Moment.js maintainer and offers powerful internationalization support.

Expand All @@ -61,7 +61,7 @@ const tomorrow = moment().add(1, 'day') // [!code --]
const tomorrow = DateTime.now().plus({ days: 1 }) // [!code ++]
```

## Native JavaScript `Date`
## `Date` (native)

For simple use cases, native JavaScript [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) and [`Intl`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) APIs may be sufficient:

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/npm-run-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Another option is [concurrently](https://github.com/open-cli-tools/concurrently)
}
```

## `Wireit`
## `wireit`

For more advanced workflows, consider [Wireit](https://github.com/google/wireit). It integrates directly into `package.json` to add caching, dependency graphs, watch mode, and incremental builds. Unlike `npm-run-all`, Wireit upgrades your existing `npm run` experience instead of providing a separate CLI.

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/path-exists.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Modern alternatives to the path-exists package for checking if a pa

# Replacements for `path-exists`

## Node.js (async)
## Async `fs.access` (native, Node.js)

Use [`fs/promises.access`](https://nodejs.org/docs/latest/api/fs.html#fspromisesaccesspath-mode) and return a boolean.

Expand All @@ -16,7 +16,7 @@ const exists = await pathExists('/etc/passwd') // [!code --]
const exists = await access('/etc/passwd').then(() => true, () => false) // [!code ++]
```

## Node.js (sync)
## Sync `fs.existsSync` (native, Node.js)

Added in v0.1.21: synchronous path/file existence check via [`fs.existsSync`](https://nodejs.org/docs/latest/api/fs.html#fsexistssyncpath).

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/qs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Modern alternatives to the qs package for parsing and serializing q

# Replacements for `qs`

## `URLSearchParams`
## `URLSearchParams` (native)

[`URLSearchParams`](https://developer.mozilla.org/docs/Web/API/URLSearchParams) is built into browsers and Node.js (>= 10). Use it when you don’t need nested objects or automatic array parsing. It preserves multiple values via `getAll`, and `toString()` gives you a URL-safe query string.

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/readable-stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Modern alternatives to the readable-stream package for working with

[`readable-stream`](https://www.npmjs.com/package/readable-stream) mirrors Node’s core streams and works in browsers. In most cases, prefer native options.

## Node.js (since v0.9.4)
## `node:stream` (native, since Node.js v0.9.4)

Use the built-in `stream` module ([Node Streams docs](https://nodejs.org/api/stream.html)).

Expand All @@ -15,7 +15,7 @@ import { Duplex, Readable, Transform, Writable } from 'readable-stream' // [!cod
import { Duplex, Readable, Transform, Writable } from 'node:stream' // [!code ++]
```

## Streams API (Browsers and Node.js 16.5.0+)
## Web Streams (native, browsers and Node.js 16.5.0+)

Use the [Web Streams API (MDN)](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) in browsers and modern Node. It’s global in Node 18+ ([Node Web Streams docs](https://nodejs.org/api/webstreams.html)); on 16.5–17.x import from `stream/web` ([details](https://nodejs.org/api/webstreams.html#streamweb-the-web-streams-api)). Interop with Node streams is available via [Readable.toWeb](https://nodejs.org/api/stream.html#streamreadabletowebstreamreadable-options) and [Writable.fromWeb](https://nodejs.org/api/stream.html#streamwritablefromwebwritablestream-options).

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/rimraf.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Native Node.js alternatives to the rimraf package for recursive dir

# Replacements for `rimraf`

## Node.js
## `fs.rm` (native, Node.js)

Node.js v14.14.0 and above provide a native alternative: [`fs.rm`](https://nodejs.org/api/fs.html#fspromisesrmpath-options). It supports recursive deletion and works as a direct replacement.

Expand All @@ -16,7 +16,7 @@ await rimraf('./dist') // [!code --]
await rm('./dist', { recursive: true, force: true }) // [!code ++]
```

## Node.js (before v14.14.0)
## `fs.rmdir` (native, Node.js before v14.14.0)

If you need to support Node.js 12 up to 14.13, you can use [`fs.rmdir`](https://nodejs.org/api/fs.html#fsrmdirpath-options-callback) with the recursive option. This was added in Node v12.10.0, though it’s deprecated as of Node v14.

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/sort-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Modern alternatives to the sort-object package for sorting object k

# Replacements for `sort-object`

## JavaScript APIs (`Object.keys` + `Array.sort`)
## `Object.entries` and `Array.sort` (native)

For simple cases:

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/strip-ansi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Native Node.js alternatives to the strip-ansi package for removing

# Replacements for `strip-ansi`

## Node.js
## `util.stripVTControlCharacters` (native, Node.js)

Added in v16.11.0, [util.stripVTControlCharacters](https://nodejs.org/api/util.html#utilstripvtcontrolcharactersstr) can be used to strip ANSI escape codes from a string.

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/tempy.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Modern alternatives to the tempy package for creating temporary fil

# Replacements for `tempy`

## Node.js (since v14.x)
## `fs.mkdtemp` (native, since Node.js v14.x)

Node.js has the [`fs.mkdtemp`](https://nodejs.org/api/fs.html#fsmkdtempprefix-options-callback) function for creating a unique temporary directory. Directory cleanup can be done by passing `{recursive: true}` to [`fs.rm`](https://nodejs.org/api/fs.html#fsrmpath-options-callback), available in v14.14.0 and up.

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/uri-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Modern alternatives to uri-js for RFC 3986 URI parsing, resolving,

[`uri-js`](https://github.com/garycourt/uri-js) is unmaintained and triggers deprecation warnings on modern Node.js ([due to `punycode`](https://github.com/garycourt/uri-js/pull/95)).

## Native `URL`
## `URL` (native)

Good for standard web URLs (http/https/ws/wss/file/mailto, etc.).

Expand Down
4 changes: 2 additions & 2 deletions docs/modules/utf8.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Modern alternatives to the utf8 package for UTF-8 encoding and deco

Modern Node and browsers provide native UTF-8 APIs, so this dependency is rarely needed.

## TextEncoder/TextDecoder (built-in)
## TextEncoder/TextDecoder (native)

The built-in [`TextEncoder`](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder) and [`TextDecoder`](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder) APIs provide a native way to handle UTF-8 encoding and decoding.

Expand All @@ -21,7 +21,7 @@ const decoder = new TextDecoder('utf-8', { fatal: true });
const decodedText = decoder.decode(utf8Bytes); // "€"
```

## Buffer (Node.js)
## Buffer (native)

Node's built-in [`Buffer`](https://nodejs.org/api/buffer.html) provides both `Buffer.from(str, 'utf8')` and `buf.toString('utf8')` methods for UTF-8 encoding and decoding.

Expand Down
Loading