Awesome Open Source
Awesome Open Source
Sponsorship

The NodeJS driver for EdgeDB

Build Status NPM Join GitHub discussions

edgedb is the official EdgeDB driver for JavaScript and TypeScript.

The library requires NodeJS 10 or later.

Installation

npm install edgedb --save

or

yarn add edgedb --save

Quick Start

Follow the EdgeDB tutorial to get EdgeDB installed and minimally configured.

Next, create the package.json file:

mkdir myproject
cd myproject
npm init

Next, install the "edgedb" library:

npm install edgedb --save

And here's a simple script to connect to an EdgeDB instance and run a simple query:

const edgedb = require("edgedb");

async function main() {
  const conn = await edgedb.connect({
    user: "edgedb",
    host: "127.0.0.1",
  });

  console.log(await conn.fetchOne("SELECT 1 + 1"));

  await conn.close();
}

main();

Development

A local installation of EdgeDB is required to run tests. Download EdgeDB from here or build it manually.

We use TypeScript, yarn, prettier, and tslint to develop edgedb-js. To run the test suite, run yarn test. To lint or format the code, run yarn lint / yarn format.

License

edgedb-js is developed and distributed under the Apache 2.0 license.


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
typescript (9,426
high-performance (179

Find Open Source By Browsing 7,000 Topics Across 59 Categories