1 | # web3-utils
|
2 |
|
3 | This is a sub package of [web3.js][repo]
|
4 |
|
5 | This contains useful utility functions for Dapp developers.
|
6 | Please read the [documentation][docs] for more.
|
7 |
|
8 | ## Installation
|
9 |
|
10 | ### Node.js
|
11 |
|
12 | ```bash
|
13 | npm install web3-utils
|
14 | ```
|
15 |
|
16 | ### In the Browser
|
17 |
|
18 | Build running the following in the [web3.js][repo] repository:
|
19 |
|
20 | ```bash
|
21 | npm run-script build-all
|
22 | ```
|
23 |
|
24 | Then include `dist/web3-utils.js` in your html file.
|
25 | This will expose the `Web3Utils` object on the window object.
|
26 |
|
27 |
|
28 | ## Usage
|
29 |
|
30 | ```js
|
31 | // in node.js
|
32 | var Web3Utils = require('web3-utils');
|
33 | console.log(Web3Utils);
|
34 | {
|
35 | sha3: function(){},
|
36 | soliditySha3: function(){},
|
37 | isAddress: function(){},
|
38 | ...
|
39 | }
|
40 | ```
|
41 |
|
42 |
|
43 | [docs]: http://web3js.readthedocs.io/en/1.0/
|
44 | [repo]: https://github.com/ethereum/web3.js
|
45 |
|
46 |
|