You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-3Lines changed: 34 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ The official ArangoDB low-level JavaScript client.
10
10
11
11
The driver is being tested with ArangoDB 2.5, 2.6 and 2.7 using Node.js 0.12, 4.2 and stable. Versions outside of this range may be compatible but are not officially supported.
12
12
13
+
As of version 4.0.0 of this driver, a minified standalone browser bundle is also available.
14
+
13
15
# Install
14
16
15
17
## With NPM
@@ -18,6 +20,12 @@ The driver is being tested with ArangoDB 2.5, 2.6 and 2.7 using Node.js 0.12, 4.
let {query, bindVars} = aqlQuery`RETURN ${Date.now()}`;
46
+
47
+
// or plain old Node-style
48
+
49
+
var arangojs =require('arangojs');
50
+
var db1 =arangojs();
51
+
var db2 =newarangojs.Database();
52
+
var aql =arangojs.aqlQuery(['RETURN ', ''], Date.now());
53
+
var query =aql.query;
54
+
var bindVars =aql.bindVars;
55
+
```
56
+
30
57
# API
31
58
32
59
All asynchronous functions take an optional node-style callback (or "errback") with the following arguments:
@@ -86,16 +113,20 @@ If *config* is a string, it will be interpreted as *config.url*.
86
113
87
114
***agent**:`Agent` (optional)
88
115
89
-
An http Agent instance to use forconnections. This has no effect in the browser.
116
+
An http Agent instance to use for connections.
117
+
118
+
By default a new [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) (or https.Agent) instance will be created using the *agentOptions*.
90
119
91
-
By default a new [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) instance will be created using the *agentOptions*.
120
+
This option has no effect when using the browser version of arangojs.
92
121
93
122
***agentOptions**:`Object` (Default: see below)
94
123
95
-
An object with options for the agent. This will be ignored if*agent* is also provided and has no effect in the browser.
124
+
An object with options for the agent. This will be ignored if*agent* is also provided.
In the browser version of arangojs this option can be used to pass additional options to the underlying calls of the [`xhr`](https://www.npmjs.com/package/xhr) module. The options `keepAlive` and `keepAliveMsecs` have no effect in the browser but `maxSockets` will still be used to limit the amount of parallel requests made by arangojs.
129
+
99
130
***promise**:`Class` (optional)
100
131
101
132
The `Promise` implementation to use or `false` to disable promises entirely.
0 commit comments