Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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
# or
yarn add edgedb

Quickstart

First, go through the EdgeDB Quickstart to install EdgeDB and set up your first EdgeDB project.

Now in your project directory, install the "edgedb" library:

npm init

npm install edgedb

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

const edgedb = require("edgedb");

async function main() {
  const conn = await edgedb.connect();

  try {

    console.log(
      await conn.querySingle(`SELECT re_replace('World', 'EdgeDB',
       'Hello World!')`)
    );

  } finally {
    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.