38 lines
1.9 KiB
Markdown
38 lines
1.9 KiB
Markdown
[](https://polkadot.js.org)
|
|

|
|
[](https://github.com/Flet/semistandard)
|
|
[](https://www.npmjs.com/package/@polkadot/util)
|
|
[](https://travis-ci.org/polkadot-js/common)
|
|
[](https://codeclimate.com/github/polkadot-js/common/maintainability)
|
|
[](https://coveralls.io/github/polkadot-js/common?branch=master)
|
|
[](https://david-dm.org/polkadot-js/common?path=packages/util)
|
|
[](https://david-dm.org/polkadot-js/common?path=packages/util#info=devDependencies)
|
|
|
|
# @polkadot/util
|
|
|
|
Various useful utility functions that are used across all projects in the [@polkadot](https://polkadot.js.org) namespace. It provides utility functions with additional safety checks, allowing not only for consistent coding, but also reducing the general boilerplate.
|
|
|
|
## Usage
|
|
|
|
Installation -
|
|
|
|
```
|
|
npm install --save @polkadot/util
|
|
```
|
|
|
|
Functions can be imported directly from the package, e.g.
|
|
|
|
```js
|
|
import { isHex } from '@polkadot/util';
|
|
```
|
|
|
|
Alternatively the function can be accessed directly,
|
|
|
|
```js
|
|
import isHex from '@polkadot/util/is/hex';
|
|
```
|
|
|
|
## Available Utilities
|
|
|
|
For a list of currently exposed methods, see the [library documentation](docs/README.md).
|