Package Exports
- web3-utils
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (web3-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
web3-utils
This is a sub package of web3.js
This contains useful utility functions for Dapp developers.
Please read the documentation for more.
Installation
npm install web3-utilsUsage
Import all of the utils functions
import * as Utils from 'web3-utils';
console.log(Utils);
> {
sha3: Function,
soliditySha3: Function,
isAddress: Function,
...
}Import what you need
import { asciiToHex } from 'web3-utils';
console.log(asciiToHex('I have 100!'));
> "0x49206861766520313030e282ac"Types
All the typescript typings are placed in the types folder.