# @0xproject/utils

> 0x TS utils

Latest version **2.0.2** (published 2018-10-04) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @0xproject/utils
pnpm add @0xproject/utils
yarn add @0xproject/utils
bun add @0xproject/utils
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2018-10-04 |
| First published | 2017-12-08 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.12 |
| Dependencies | 12 |
| Unpacked size | 75.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1408 |
| Maintainers | albrow, amirbandeali, bchillman, dekz, fberger, fragosti, logvinov |

## Links

- npm: https://www.npmjs.com/package/@0xproject/utils
- Repository: https://github.com/0xProject/0x-monorepo
- Homepage: https://github.com/0xProject/0x-monorepo/packages/utils/README.md
- Issues: https://github.com/0xProject/0x-monorepo/issues
- npm.io page: https://npm.io/package/@0xproject/utils

## Dependencies (12)

- [ethers](https://npm.io/package/ethers.md) 4.0.0-beta.14
- [lodash](https://npm.io/package/lodash.md) ^4.17.5
- [js-sha3](https://npm.io/package/js-sha3.md) ^0.7.0
- [@types/node](https://npm.io/package/@types/node.md) *
- [detect-node](https://npm.io/package/detect-node.md) 2.0.3
- [bignumber.js](https://npm.io/package/bignumber.js.md) ~4.1.0
- [ethereum-types](https://npm.io/package/ethereum-types.md) ^1.0.11
- [ethereumjs-util](https://npm.io/package/ethereumjs-util.md) ^5.1.1
- [@0xproject/types](https://npm.io/package/@0xproject/types.md) ^1.1.4
- [isomorphic-fetch](https://npm.io/package/isomorphic-fetch.md) ^2.2.1
- [abortcontroller-polyfill](https://npm.io/package/abortcontroller-polyfill.md) ^1.1.9
- [@0xproject/typescript-typings](https://npm.io/package/@0xproject/typescript-typings.md) ^3.0.2

## Recent versions

- 2.0.2 (latest) — 2018-10-04
- 2.0.0 — 2018-09-28
- 1.0.11 — 2018-09-25
- 1.0.10 — 2018-09-25
- 1.0.9 — 2018-09-21
- 1.0.8 — 2018-09-05
- 1.0.7 — 2018-08-27
- 1.0.6 — 2018-08-24
- 1.0.5 — 2018-08-14
- 1.0.4 — 2018-07-26
- 1.0.3 — 2018-07-26
- 1.0.2 — 2018-07-26
- 1.0.0 — 2018-07-19
- 0.7.3 — 2018-07-18
- 0.7.2 — 2018-07-09
- … 26 more at https://npm.io/package/@0xproject/utils/versions

## README

## @0xproject/utils

Utils to be shared across 0x projects and packages

## Installation

```bash
yarn add @0xproject/utils
```

If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:

```json
"compilerOptions": {
    "typeRoots": ["node_modules/@0xproject/typescript-typings/types", "node_modules/@types"],
}
```

## Usage

```javascript
import { addressUtils, bigNumberConfigs, classUtils, intervalUtils, promisify } from '@0xproject/utils';
```

## Troubleshooting

If you are still seeing TS type errors complaining about missing DOM types such as `Response`:

```
error TS2304: Cannot find name 'Response'.
```

Then you need to explicitly add the `dom` lib to your compiler options in `tsconfig.json`. The `dom` library is included by default, but customizing the `lib` option can cause it to be dropped.

```
"compilerOptions": {
    "lib": [..., "dom"],
```

## Contributing

We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.

Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started.

### Install dependencies

If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:

```bash
yarn config set workspaces-experimental true
```

Then install dependencies

```bash
yarn install
```

### Build

To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:

```bash
PKG=@0xproject/utils yarn build
```

Or continuously rebuild on change:

```bash
PKG=@0xproject/utils yarn watch
```

### Clean

```bash
yarn clean
```

### Lint

```bash
yarn lint
```

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