Promise based terminus client for the browser and node.js
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.
Before installing, download and install Node.js. Node.js 0.10 or higher is required.
Installation is done using the npm install command:
Using npm:
$ npm install --save @terminusdb/terminusdb-client
Using cdn:
<script src="https://unpkg.com/@terminusdb/terminusdb-client/dist/terminusdb-client.min.js"></script>
Downloading:
Download the terminusdb-client.min.js file from the /dist directory and save it to your location of choice, then:
<script src="http://my.saved.location/terminusdb-client.min.js"></script>
For the full Documentation
//
const TerminusClient = require('@terminusdb/terminusdb-client');
//Create a new instance of terminusDB client
const client = new TerminusClient.WOQLClient("https://127.0.0.1:6363/",{
dbid:"test_db",
user:"admin",
key:"my_secret_key"
});
//Connect to a TerminusDB server at the given URI with an API key
client.connect().
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
.finally(function () {
// always executed
});
//use async/await.
async function getCapabilities() {
try {
const response = await client.connect();
console.log(response);
} catch (err) {
console.error(err);
}
}
connections options.
To initialize TerminusDB client
with custom options use
const TerminusClient = require('@terminusdb/terminusdb-client')
const client = new TerminusClient.WOQLClient("https://127.0.0.1:6363/", {
dbid:"test_db",
user:"admin",
key:"my_secret_key"
});
The API is documented at: https://terminusdb.github.io/terminusdb-client/
If you have encounter any issues, please report it with your os and environment setup, version that you are using and a simple reproducible case.
If you encounter other questions, you can ask in our community forum or Slack channel.
It will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas. Do not forget to add a bit of test(s) of what value you adding.
Please check Contributing.md for more information.
The APACHE 2.0 License
Copyright (c) 2019