FalkorDB Typescript Client
53
stars
811
commits
TypeScript
primary language
Sep 10, 2026
updated
falkordb is a FalkorDB client for Node.js.
Start a falkordb via docker:
docker run -p 6379:6379 -it falkordb/falkordb:latest
To install node falkordb, simply:
npm install falkordb
import { FalkorDB } from 'falkordb';
const db = await FalkorDB.connect({
host: 'localhost',
port: 6379,
username: 'myUsername',
password: 'myPassword'
})
console.log('Connected to FalkorDB')
const graph = db.selectGraph('myGraph')
await graph.query(`CREATE (:Rider {name:'Valentino Rossi'})-[:rides]->(:Team {name:'Yamaha'}),
(:Rider {name:'Dani Pedrosa'})-[:rides]->(:Team {name:'Honda'}),
(:Rider {name:'Andrea Dovizioso'})-[:rides]->(:Team {name:'Ducati'})`)
const result = await graph.query(`MATCH (r:Rider)-[:rides]->(t:Team)
WHERE t.name = $name RETURN r.name`,
{params: {name: 'Yamaha'}})
console.log(result) // Valentino Rossi
console.log(await db.list())
console.log(await db.info())
db.close()
To learn more about Cypher query language check: https://docs.falkordb.com/cypher/
host and port are the shorthand for a plain TCP connection and default to localhost:6379.
You can also pass a connection URL:
const db = await FalkorDB.connect({ url: 'falkor://localhost:6379' })
For anything beyond host and port — TLS, connection timeouts, keep-alive — use socket, which is
passed to the underlying node-redis client:
const db = await FalkorDB.connect({
socket: {
host: 'localhost',
port: 6379,
tls: true,
connectTimeout: 5000
}
})
url sets the connection address, so it overrides the top-level host and port. Other
socket settings such as TLS and timeouts still apply alongside it. When both are given,
socket.host and socket.port take precedence over the top-level host and port.
.stubs()Lists the graphs that are currently offloaded to disk ("stubs"). db.list() already includes
offloaded graphs, so stubs() is how you tell which of the listed graphs are not loaded in memory.
GRAPH.STUBS is provided by the FalkorDB Enterprise graph-offloading module, so on deployments
without that module the call rejects with an "unknown command" error — treat that as
"offloading is not supported here".
On a cluster the replies of all master nodes are combined. If only some masters fail, the partial result is returned and the failures are logged; the call rejects only when every master fails.
const offloaded = await db.stubs();
.close()Forcibly close a client's connection to FalkorDB immediately. Calling close will not send further pending commands to the Redis server, or wait for or parse outstanding responses.
await client.close();
For information on how to release a new version to npm, see RELEASE.md.
This repository is licensed under the "MIT" license. See LICENSE.
TypeScript
99.4%
FalkorDB Typescript Client
53
stars
811
commits
TypeScript
primary language
Sep 10, 2026
updated
falkordb is a FalkorDB client for Node.js.
Start a falkordb via docker:
docker run -p 6379:6379 -it falkordb/falkordb:latest
To install node falkordb, simply:
npm install falkordb
import { FalkorDB } from 'falkordb';
const db = await FalkorDB.connect({
host: 'localhost',
port: 6379,
username: 'myUsername',
password: 'myPassword'
})
console.log('Connected to FalkorDB')
const graph = db.selectGraph('myGraph')
await graph.query(`CREATE (:Rider {name:'Valentino Rossi'})-[:rides]->(:Team {name:'Yamaha'}),
(:Rider {name:'Dani Pedrosa'})-[:rides]->(:Team {name:'Honda'}),
(:Rider {name:'Andrea Dovizioso'})-[:rides]->(:Team {name:'Ducati'})`)
const result = await graph.query(`MATCH (r:Rider)-[:rides]->(t:Team)
WHERE t.name = $name RETURN r.name`,
{params: {name: 'Yamaha'}})
console.log(result) // Valentino Rossi
console.log(await db.list())
console.log(await db.info())
db.close()
To learn more about Cypher query language check: https://docs.falkordb.com/cypher/
host and port are the shorthand for a plain TCP connection and default to localhost:6379.
You can also pass a connection URL:
const db = await FalkorDB.connect({ url: 'falkor://localhost:6379' })
For anything beyond host and port — TLS, connection timeouts, keep-alive — use socket, which is
passed to the underlying node-redis client:
const db = await FalkorDB.connect({
socket: {
host: 'localhost',
port: 6379,
tls: true,
connectTimeout: 5000
}
})
url sets the connection address, so it overrides the top-level host and port. Other
socket settings such as TLS and timeouts still apply alongside it. When both are given,
socket.host and socket.port take precedence over the top-level host and port.
.stubs()Lists the graphs that are currently offloaded to disk ("stubs"). db.list() already includes
offloaded graphs, so stubs() is how you tell which of the listed graphs are not loaded in memory.
GRAPH.STUBS is provided by the FalkorDB Enterprise graph-offloading module, so on deployments
without that module the call rejects with an "unknown command" error — treat that as
"offloading is not supported here".
On a cluster the replies of all master nodes are combined. If only some masters fail, the partial result is returned and the failures are logged; the call rejects only when every master fails.
const offloaded = await db.stubs();
.close()Forcibly close a client's connection to FalkorDB immediately. Calling close will not send further pending commands to the Redis server, or wait for or parse outstanding responses.
await client.close();
For information on how to release a new version to npm, see RELEASE.md.
This repository is licensed under the "MIT" license. See LICENSE.
TypeScript
99.4%