webdggrid 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +31 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webdggrid",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Wasm package for DGGRID ",
5
5
  "type": "module",
6
6
  "exports": {
package/readme.md CHANGED
@@ -1,13 +1,37 @@
1
1
  ## Web Assembly version of DGGRID
2
2
 
3
- ### Under development
3
+ <div align="center">
4
+
5
+ ![NPM Version](https://img.shields.io/npm/v/webdggrid?style=flat-square)
6
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/am2222/webDggrid/deploy.yml?style=flat-square&label=docs) ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/am2222/webDggrid/main.yml?style=flat-square&label=npm%20pacakge) [![](https://data.jsdelivr.com/v1/package/npm/webdggrid/badge)](https://www.jsdelivr.com/package/npm/webdggrid)
7
+
8
+ </div>
9
+
10
+ ## How to use
11
+ Please check `tests` folder for more examples.
12
+
13
+ in browser
14
+
15
+ ```js
4
16
 
17
+ const WebdggridLocal = await import("../dist/index.js").then(m => m.Webdggrid).catch(console.log);
18
+ import { Webdggrid as WebdggridExternal } from "https://cdn.jsdelivr.net/npm/webDggrid/dist/index.js";
5
19
 
6
- node ./utils/sfx-wasm.js -d ./lib-wasm/libdggrid.wasm > ./lib-esm/libdggrid.wasm.js
20
+ const Webdggrid = WebdggridLocal ?? WebdggridExternal;
7
21
 
8
-
9
- # server
22
+ const webdggrid = await Webdggrid.load();
23
+ const seqNum = dggs.geoToSequenceNum([[0, 0]]);
10
24
 
11
- `
12
- npx http-server -o ./lib-wasm
13
- `
25
+ ```
26
+
27
+
28
+ In nodejs
29
+
30
+ ```js
31
+ import { Webdggrid } from 'webdggrid'
32
+ const dggs = await Webdggrid.load();
33
+ const seqNum = dggs.geoToSequenceNum([[0, 0]]);
34
+
35
+ ```
36
+
37
+ ### Under development