edgedb is the official EdgeDB driver for JavaScript and TypeScript.
The library requires NodeJS 10 or later.
npm install edgedb --save
or
yarn add edgedb --save
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();
We use yarn to develop edgedb-js.
Instructions for installing EdgeDB and edgedb-js locally can be found here.
To run the test suite, run yarn test
.
edgedb-js is developed and distributed under the Apache 2.0 license.