# web3-utils

> Collection of utility functions used in web3.js.

Latest version **4.3.3** (published 2024-12-03) · LGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install web3-utils
pnpm add web3-utils
yarn add web3-utils
bun add web3-utils
```

## Health

**Score 45/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score; popular repo.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.3.3 |
| Published | 2024-12-03 |
| First published | 2016-08-31 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14 |
| Dependencies | 5 |
| Unpacked size | 536.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19919 |
| Author | ChainSafe Systems |
| Maintainers | luu-alex, mpetrunic, gregthegreek, jdevcs |

## Links

- npm: https://www.npmjs.com/package/web3-utils
- Repository: https://github.com/ChainSafe/web3.js
- Homepage: https://github.com/ChainSafe/web3.js#readme
- Issues: https://github.com/ChainSafe/web3.js/issues
- npm.io page: https://npm.io/package/web3-utils

## Dependencies (5)

- [web3-types](https://npm.io/package/web3-types.md) ^1.10.0
- [web3-errors](https://npm.io/package/web3-errors.md) ^1.3.1
- [eventemitter3](https://npm.io/package/eventemitter3.md) ^5.0.1
- [web3-validator](https://npm.io/package/web3-validator.md) ^2.0.6
- [ethereum-cryptography](https://npm.io/package/ethereum-cryptography.md) ^2.0.0

## Recent versions

- 4.3.3 (latest) — 2024-12-03
- 4.3.4-dev.bf16917.0 (dev) — 2025-01-17
- 1.10.4 (legacy) — 2024-02-05
- 1.10.4-dev.0 (legacy-dev) — 2024-01-31
- 4.0.4-rc.0 (rc) — 2023-08-09
- 1.10.1-rc.0 (rc-legacy) — 2023-08-08
- 4.3.4-dev.bc4a34b.0 — 2025-01-16
- 4.3.4-dev.89976a9.0 — 2025-01-14
- 4.3.4-dev.ae99434.0 — 2024-12-11
- 4.3.4-dev.fa5ce5b.0 — 2024-12-10
- 4.3.4-dev.f41ca32.0 — 2024-12-10
- 4.3.4-dev.594f83a.0 — 2024-12-03
- 4.3.3-dev.b3ee417.0 — 2024-12-03
- 4.3.3-dev.acdb0c7.0 — 2024-12-03
- 4.3.3-dev.926044b.0 — 2024-11-26
- … 503 more at https://npm.io/package/web3-utils/versions

## README

<p align="center">
  <img src="assets/logo/web3js.jpg" width="500" alt="web3.js" />
</p>

# web3-utils

![ES Version](https://img.shields.io/badge/ES-2020-yellow)
![Node Version](https://img.shields.io/badge/node-14.x-green)
[![NPM Package][npm-image]][npm-url]
[![Downloads][downloads-image]][npm-url]

This is a sub-package of [web3.js][repo].

`web3-utils` This contains useful utility functions for Dapp developers.

## Installation

You can install the package either using [NPM](https://www.npmjs.com/package/web3-utils) or using [Yarn](https://yarnpkg.com/package/web3-utils)

### Using NPM

```bash
npm install web3-utils
```

### Using Yarn

```bash
yarn add web3-utils
```

## Usage

```js
const Web3Utils = require('web3-utils');
console.log(Web3Utils);
{
    sha3: function(){},
    soliditySha3: function(){},
    isAddress: function(){},
    ...
}
```

## Getting Started

-   :writing_hand: If you have questions [submit an issue](https://github.com/ChainSafe/web3.js/issues/new) or join us on [Discord](https://discord.gg/yjyvFRP)
    ![Discord](https://img.shields.io/discord/593655374469660673.svg?label=Discord&logo=discord)

## Prerequisites

-   :gear: [NodeJS](https://nodejs.org/) (LTS/Fermium)
-   :toolbox: [Yarn](https://yarnpkg.com/)/[Lerna](https://lerna.js.org/)

## Package.json Scripts

| Script           | Description                                        |
| ---------------- | -------------------------------------------------- |
| clean            | Uses `rimraf` to remove `dist/`                    |
| build            | Uses `tsc` to build package and dependent packages |
| lint             | Uses `eslint` to lint package                      |
| lint:fix         | Uses `eslint` to check and fix any warnings        |
| format           | Uses `prettier` to format the code                 |
| test             | Uses `jest` to run unit tests                      |
| test:integration | Uses `jest` to run tests under `/test/integration` |
| test:unit        | Uses `jest` to run tests under `/test/unit`        |

[docs]: https://docs.web3js.org/
[repo]: https://github.com/web3/web3.js/tree/4.x/packages/web3-utils
[npm-image]: https://img.shields.io/github/package-json/v/web3/web3.js/4.x?filename=packages%2Fweb3-utils%2Fpackage.json
[npm-url]: https://npmjs.org/package/web3-utils
[downloads-image]: https://img.shields.io/npm/dm/web3-utils?label=npm%20downloads

---
_Source: https://npm.io/package/web3-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
