UNPKG

1.43 kBMarkdownView Raw
1# [Loom.js](https://loomx.io) [![Build Status](https://travis-ci.org/loomnetwork/loom-js.svg?branch=master)](https://travis-ci.org/loomnetwork/loom-js)
2
3JS library for building browser apps & NodeJS services that interact with Loom DAppChains.
4
5## Install
6
7### NodeJS
8
9```
10# NPM
11npm install loom-js
12# Yarn
13yarn add loom-js
14```
15
16### Browser
17
18```html
19<script src="https://cdn.jsdelivr.net/npm/loom-js@1.9.0/dist/loom.umd.js"></script>
20```
21
22## Development
23
24```shell
25# build for Node
26yarn build
27# build for Browser
28yarn build:browser
29# run unit tests on Node & Browser
30yarn test
31# auto-format source files
32yarn format
33# run unit tests in Node
34yarn test:node
35# run unit tests in Electon
36yarn test:browser
37# run e2e test in Node (local DAppChain node must be running first)
38yarn e2e:node
39# run e2e test in Electron (local DAppChain node must be running first)
40yarn e2e:browser
41```
42
43The e2e test environment can be configured by changing `.env.test` (see `.env.test.example` for
44default values).
45
46### Regenerating Protobufs
47
48Whenever you change `src/proto/loom.proto`, or `src/tests/tests.proto` you will need to regenerate
49the corresponding `*_pb.js` by running:
50
51```shell
52yarn proto
53```
54
55The shell must be able to locate the `protoc` binary, which can be obtained from https://github.com/google/protobuf/releases
56
57## License
58
59BSD 3-Clause, see `LICENSE` file for details.