arxpoetica / arangojs

The official ArangoDB JavaScript driver.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ArangoDB JavaScript Driver

The official ArangoDB low-level JavaScript client.

license - APACHE-2.0 Dependencies Build status

NPM status

js-standard-style

Install

With Yarn or NPM

yarn add arangojs
## - or -
npm install --save arangojs

From source

git clone https://github.com/arangodb/arangojs.git
cd arangojs
npm install
npm run dist

Basic usage example

// Modern JavaScript
import { Database, aql } from "arangojs";
const db = new Database();
(async function() {
  const now = Date.now();
  try {
    const cursor = await db.query(aql`RETURN ${now}`);
    const result = await cursor.next();
    // ...
  } catch (err) {
    // ...
  }
})();

// or plain old Node-style
var arangojs = require("arangojs");
var db = new arangojs.Database();
var now = Date.now();
db
  .query({
    query: "RETURN @value",
    bindVars: { value: now }
  })
  .then(function(cursor) {
    return cursor.next().then(function(result) {
      // ...
    });
  })
  .catch(function(err) {
    // ...
  });

Documentation

Latest Documentation on GitHub

License

The Apache License, Version 2.0. For more information, see the accompanying LICENSE file.

About

The official ArangoDB JavaScript driver.

License:Apache License 2.0


Languages

Language:TypeScript 99.2%Language:JavaScript 0.8%