/typedb-client-nodejs

TypeDB Client for Node.js

Primary LanguageTypeScriptApache License 2.0Apache-2.0

TypeDB Client for Node.js

Factory Discord Discussion Forum Stack Overflow Stack Overflow

Client Architecture

To learn about the mechanism that a TypeDB Client uses to set up communication with databases running on the TypeDB Server, refer to TypeDB > Client API > Overview.

API Reference

To learn about the methods available for executing queries and retrieving their answers using Client Node.js, refer to TypeDB > Client API > Node.js > API Reference.

Concept API

To learn about the methods available on the concepts retrieved as the answers to TypeQL queries, refer to TypeDB > Concept API > Overview.

Installation

Node.js version 14 or above is recommended.

npm install typedb-client

Further documentation: https://docs.vaticle.com/docs/client-api/nodejs

Using TypeScript

typedb-client is a TypeScript project and provides its own type definitions out of the box - for example:

import { EntityType } from 'typedb-client';

Build TypeDB Client for Node.js from Source

Note: You don't need to compile TypeDB Client from source if you just want to use it in your code. See the "Import TypeDB Client for Node.js" section above.

We recommend using yarn, see https://yarnpkg.com/ for information about yarn.

  1. Make sure you have the following installed: Node.js (version 14 or above); npm package manager; yarn package manager.
  2. Clone the project and run yarn at the root directory (containing package.json)
  3. Run yarn run build
  4. The JavaScript files, and their matching TypeScript type definitions are compiled to the dist directory.

Note: TypeDB Client can be run without TypeScript, however its type assertions may make development smoother.