Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Javascript client for TerminusDB - reference implementation of API

License

Notifications You must be signed in to change notification settings

harmanbains/terminusdb-client-js

 
 

Repository files navigation

terminusdb-client

build status Coverage Status

Promise based terminus client for the browser and node.js

Requirements

Installation

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.

NPM Module

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

Minified Script

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>

Usage

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);
  }
}

Options

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"
});

API

The API is documented at: https://terminusdb.github.io/terminusdb-client/

Report Issues

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.

Contribute

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.

Licence

The APACHE 2.0 License

Copyright (c) 2019

About

Javascript client for TerminusDB - reference implementation of API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.1%
  • Other 0.9%