From 905a95c358ed0214a1894adbc1e09dafcc14f2d9 Mon Sep 17 00:00:00 2001 From: Miguel Mota Date: Mon, 24 Apr 2023 00:23:21 -0700 Subject: [PATCH] Update docs --- docs/README.md | 14 ++++++++++++++ docs/classes/_src_merkletree_.merkletree.md | 8 ++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/README.md b/docs/README.md index 8626e69..226905a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -43,6 +43,18 @@ From [NPM](https://www.npmjs.com/package/merkletreejs): npm install merkletreejs ``` +Import as ES6 module + +```js +import { MerkleTree } from 'merkletreejs' +``` + +Import as CommonJs + +```js +const { MerkleTree } = require('merkletreejs') +``` + ### CDN Available on [jsDelivr](https://www.jsdelivr.com/) CDN: @@ -51,6 +63,8 @@ Available on [jsDelivr](https://www.jsdelivr.com/) CDN: ``` +The exported classes will be available on `window` object, e.g. `window.MerkleTree` + ## Example [https://lab.miguelmota.com/merkletreejs](https://lab.miguelmota.com/merkletreejs) diff --git a/docs/classes/_src_merkletree_.merkletree.md b/docs/classes/_src_merkletree_.merkletree.md index dc155f7..20b90e0 100644 --- a/docs/classes/_src_merkletree_.merkletree.md +++ b/docs/classes/_src_merkletree_.merkletree.md @@ -349,7 +349,7 @@ ___ ### getHexLayers -▸ **getHexLayers**(): *string[]* +▸ **getHexLayers**(): *string[][]* getHexLayers @@ -360,7 +360,7 @@ getHexLayers const layers = tree.getHexLayers() ``` -**Returns:** *string[]* +**Returns:** *string[][]* ___ @@ -506,7 +506,7 @@ ___ ### getLayers -▸ **getLayers**(): *Buffer[]* +▸ **getLayers**(): *Buffer[][]* getLayers @@ -517,7 +517,7 @@ getLayers const layers = tree.getLayers() ``` -**Returns:** *Buffer[]* +**Returns:** *Buffer[][]* ___