Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion javascript-manual/modules/ROOT/pages/install.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,52 @@ You can install it with `npm i neo4j-driver-lite`.

== Include the driver

Unless you are going to xref:browser-websockets.adoc[use the driver within a web browser], you use the JavaScript driver in a Node.js or TypeScript application.
Unless you are going to xref:browser-websockets.adoc[use the driver within a web browser], you use the driver in a Node.js or TypeScript application.

[.tabbed-example]
=====
[.include-with-javascript]
======
To include the driver in your application, use `require`:

[source, javascript]
----
const neo4j = require('neo4j-driver')
----

======
[.include-with-typescript]
======
To include the driver in your application, use `import`:

[source, typescript]
----
import neo4j, {Node} from 'neo4j-driver'
----

[IMPORTANT]
Import `Node` explicitly to avoid conflicts with the native `Node` type. The driver also doesn't declare a namespace, so you need to explicitly import any symbol you want to use as a type annotation.

You can provide the list of libraries the driver needs via the `tsconfig.json` file (or exclude the interpreter check with `"skipLibCheck": true`), and then compile your code with `tsc` or run with an execution engine.

.tsconfig.json sample file
[source, json]
----
{
"compilerOptions": {
"lib": ["ES6", "dom", "es2020.bigint", "esnext.asynciterable", "esnext.disposable"]
},
"include": ["neo4j-main.ts"]
}
----

[TIP]
The minimum supported version is TypeScript 5.2.


======
=====


include::{common-partial}/install.adoc[tag=get-an-instance]

Expand Down
Loading