@oceanum/datamesh 0.1.0 → 0.1.1
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.
- package/README.md +25 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,30 @@
|
|
|
1
|
-
# datamesh
|
|
1
|
+
# @oceanum/datamesh
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A typescript library for interacting with the Oceanum.io Datamesh.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
You can use this library in Node.js, Deno or browser code
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```sh
|
|
10
|
+
npm install @oceanum/datamesh
|
|
11
|
+
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
import { Connector } from "@oceanum/datamesh";
|
|
17
|
+
|
|
18
|
+
//Instatiate the Datamesh Connector
|
|
19
|
+
const datamesh=Connector("my_datamesh_token"); //Get you datamesh token from your Oceanum.io account
|
|
20
|
+
|
|
21
|
+
//Define a datamesh query
|
|
22
|
+
const query={
|
|
23
|
+
"datasource":"oceanum-sizing_giants"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//Get the data
|
|
27
|
+
const data=await datamesh.query(query);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
DO NOT put your Datamesh token directly into browser code. For use in an SPA, you can either forward your Datamesh request through a proxy or implement a token exchange. Read the [library documentation](https://oceanum-js.oceanum.io/) to learn more.
|