|
1 | | -TerminusDB Client Javascript |
2 | | -========================== |
| 1 | +[][terminusdb-client-js-docs] |
3 | 2 |
|
4 | | -[](https://discord.gg/yTJKAma) |
5 | | -[](https://discuss.terminusdb.com/) |
6 | | -[](https://twitter.com/TerminusDB) |
| 3 | +[terminusdb-client-js-docs]: https://terminusdb.github.io/terminusdb-client-js/ |
7 | 4 |
|
8 | | -**Development status ⚙️** |
| 5 | +--- |
9 | 6 |
|
10 | | -[](https://travis-ci.com/terminusdb/terminusdb-client) |
11 | | -[](https://coveralls.io/repos/github/terminusdb/terminusdb-client/badge.svg?branch=master) |
| 7 | +[](https://discord.gg/yTJKAma) |
| 8 | +[](https://discuss.terminusdb.com/) |
| 9 | +[](https://twitter.com/TerminusDB) |
12 | 10 |
|
13 | | -**NPM Package status 📦** |
| 11 | +[](https://www.npmjs.com/package/@terminusdb/terminusdb-client) |
| 12 | +[](https://www.npmjs.com/package/@terminusdb/terminusdb-client) |
14 | 13 |
|
15 | | -[](https://www.npmjs.com/package/@terminusdb/terminusdb-client) |
16 | | -[](https://www.npmjs.com/package/@terminusdb/terminusdb-client) |
| 14 | +> This repository is for the JavaScript client library for TerminusDB and |
| 15 | +> TerminusX. |
17 | 16 |
|
18 | | -Promise based terminus client for the browser and node.js |
| 17 | +[**TerminusDB**][terminusdb] is an [open-source][terminusdb-repo] graph database |
| 18 | +and document store. It allows you to link JSON documents in a powerful knowledge |
| 19 | +graph all through a simple document API. |
| 20 | + |
| 21 | +[terminusdb]: https://terminusdb.com/ |
| 22 | +[terminusdb-docs]: https://terminusdb.com/docs/ |
| 23 | +[terminusdb-repo]: https://github.com/terminusdb/terminusdb |
| 24 | + |
| 25 | +**TerminusX** is a self-service data platform that allows you to build, deploy, |
| 26 | +execute, monitor, and share versioned data products. It is built on TerminusDB. |
| 27 | +TerminusX is in public beta and you can [sign up now][dashboard]. |
| 28 | + |
| 29 | +[dashboard]: https://dashboard.terminusdb.com/ |
19 | 30 |
|
20 | 31 | ## Requirements |
21 | 32 |
|
22 | | -- [NodeJS 10+](https://nodejs.org/en/) |
| 33 | +- Node.js version 10+ if using the TerminusDB client library as a Node.js package |
23 | 34 |
|
24 | 35 | ## Installation |
25 | 36 |
|
26 | | -TerminusDB Client can be used as either a Node.js module available through the npm registry, or directly included in web-sites by including the script tag below. |
| 37 | +The TerminusDB JavaScript client library can be used either as a Node.js package |
| 38 | +or as a script that runs in the browser. |
27 | 39 |
|
28 | | -### NPM Module |
| 40 | +### NPM Package |
29 | 41 |
|
30 | | -Before installing, download and install Node.js.<br> |
31 | | -NodeJS version 10.X or higher is required. NodeJS version 14.X is recommended. |
| 42 | +> :memo: If you don't already have Node.js installed, [install it][node-install] first. |
32 | 43 |
|
33 | | -Installation is done using the npm install command: |
| 44 | +[node-install]: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm |
34 | 45 |
|
35 | | -Using npm: |
| 46 | +To install the `terminusdb-client` package as a dependency in an existing |
| 47 | +package, run: |
36 | 48 |
|
37 | | -```bash |
| 49 | +```sh |
38 | 50 | $ npm install --save @terminusdb/terminusdb-client |
39 | 51 | ``` |
40 | 52 |
|
41 | | -### Minified Script |
| 53 | +This command update your `package.json`. |
| 54 | + |
| 55 | +### Script |
42 | 56 |
|
43 | | -Using cdn: |
| 57 | +To use the `terminusdb-client` script on a webpage sourced from a CDN, add this |
| 58 | +to your HTML: |
44 | 59 |
|
45 | 60 | ```html |
46 | 61 | <script src="https://unpkg.com/@terminusdb/terminusdb-client/dist/terminusdb-client.min.js"></script> |
47 | 62 | ``` |
48 | 63 |
|
49 | | -Downloading: |
| 64 | +Alternatively, you can download the latest [`terminusdb-client.min.js`][js], add |
| 65 | +it to your sources, and use that in the `<script>` instead. |
50 | 66 |
|
51 | | -Download the terminusdb-client.min.js file from the /dist directory and save it to your location of choice, then: |
52 | | - |
53 | | -```html |
54 | | -<script src="http://my.saved.location/terminusdb-client.min.js"></script> |
55 | | -``` |
| 67 | +[js]: https://unpkg.com/@terminusdb/terminusdb-client/dist/terminusdb-client.min.js |
56 | 68 |
|
57 | 69 | ## Usage |
58 | 70 |
|
59 | 71 | This example creates a simple dataProduct, starting to create a database model the schema |
60 | 72 | and insert a simple document |
61 | 73 |
|
62 | | -For the [full Documentation](https://terminusdb.github.io/terminusdb-client-js/) |
| 74 | +For the [full Documentation][terminusdb-client-js-docs] |
63 | 75 |
|
64 | 76 | ```javascript |
65 | 77 | const TerminusClient = require("@terminusdb/terminusdb-client"); |
@@ -99,7 +111,7 @@ const bankerSchema = [ |
99 | 111 |
|
100 | 112 | async function createDataProduct(){ |
101 | 113 | try{ |
102 | | - await client.connect() |
| 114 | + |
103 | 115 | await client.createDatabase("banker", {label: "Banker Account", |
104 | 116 | comment: "Testing", schema: true}) |
105 | 117 | //add the schema documents |
@@ -144,7 +156,7 @@ const client = new TerminusClient.WOQLClient("http://127.0.0.1:6363/", { |
144 | 156 |
|
145 | 157 | ## API |
146 | 158 |
|
147 | | -The API of the most recent release is documented at: <https://terminusdb.com/docs/v10.0/#/reference/reference-api> |
| 159 | +The TerminusDB API can be found at the [TerminusDB Documentation][terminusdb-docs]. |
148 | 160 |
|
149 | 161 | ## Report Issues |
150 | 162 |
|
|
0 commit comments