2024-04-25 14:56:13 +03:00
|
|
|
---
|
|
|
|
description: How to install es-toolkit
|
|
|
|
prev:
|
|
|
|
text: Introduction to es-toolkit
|
|
|
|
link: ./intro.md
|
|
|
|
next:
|
|
|
|
text: Impact on Bundle Size
|
|
|
|
link: ./bundle-size
|
|
|
|
---
|
2024-06-04 11:19:26 +03:00
|
|
|
|
|
|
|
# Installation
|
2024-04-25 14:56:13 +03:00
|
|
|
|
|
|
|
es-toolkit is available on [npm](https://npmjs.com/package/es-toolkit) for Node.js, Deno, and Bun.
|
|
|
|
|
2024-06-04 11:19:26 +03:00
|
|
|
## Node.js
|
2024-04-25 14:56:13 +03:00
|
|
|
|
|
|
|
es-toolkit supports Node.js 18 or later. Install es-toolkit with the following command:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
npm install es-toolkit
|
|
|
|
yarn add es-toolkit
|
|
|
|
pnpm install es-toolkit
|
|
|
|
```
|
|
|
|
|
2024-06-04 11:19:26 +03:00
|
|
|
## Deno
|
2024-04-25 14:56:13 +03:00
|
|
|
|
2024-06-30 07:43:58 +03:00
|
|
|
es-toolkit is also accessible via [JSR](https://jsr.io/@es-toolkit/es-toolkit) for Deno. To install es-toolkit, use the following command:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
deno add @es-toolkit/es-toolkit
|
|
|
|
```
|
|
|
|
|
2024-06-30 07:50:43 +03:00
|
|
|
Note that the package name includes an additional scope, distinct from npm, as per JSR restrictions.
|
2024-04-25 14:56:13 +03:00
|
|
|
|
|
|
|
```typescript
|
2024-06-30 07:43:58 +03:00
|
|
|
import { sum } from '@es-toolkit/es-toolkit';
|
|
|
|
|
|
|
|
sum([1, 2, 3]);
|
2024-04-25 14:56:13 +03:00
|
|
|
```
|
|
|
|
|
2024-06-04 11:19:26 +03:00
|
|
|
## Bun
|
2024-04-25 14:56:13 +03:00
|
|
|
|
|
|
|
es-toolkit is also available on Bun. You can install it via the following command:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
bun add es-toolkit
|
2024-06-04 11:19:26 +03:00
|
|
|
```
|