11# basex - A BaseX client for node.js
22===========================
33
4- This is a [ BaseX] ( http://basex.org/ ) client for Node.js. It is work in progress.
4+ This is a [ BaseX] ( http://basex.org/ ) client for Node.js.
55It uses the [ client interface] ( http://docs.basex.org/wiki/Server_Protocol )
66 via a socket connection to the BaseX server.
77
@@ -11,7 +11,7 @@ BaseX is a very light-weight, high-performance and scalable
1111Built as a lightweight Java server, BaseX also supports XSLT, Webdav and RestXQ.
1212
1313## Installing the BaseX Node client
14- [ ![ NPM ] ( https://nodei.co/npm/basex.png?stars& downloads) ]( https://nodei.co /npm/basex/ ) [ ![ NPM ] ( https://nodei.co/npm-dl/ basex.png )] ( https://nodei.co/npm /basex/ )
14+ [ ![ Npm package monthly downloads] ( https://badgen.net /npm/dm/ basex )] ( https://npmjs.ccom/package /basex )
1515
1616To install with npm:
1717
@@ -21,7 +21,7 @@ To install with npm:
2121 $ mkdir myproject
2222 cd myproject
2323 $ npm install basex
24- basex@0.9 .0 ./node_modules/basex
24+ basex@1.0 .0 ./node_modules/basex
2525```
2626
2727Once BaseX is installed and the BaseX server is running, test it.
@@ -39,7 +39,7 @@ Once BaseX is installed and the BaseX server is running, test it.
3939# # Installing BaseX
40401. Java is required
41411. [Download](http://basex.org/products/download/all-downloads/) and install BaseX
42- (tested against version 8.6)
42+ (tested against versions 9.6, 8.6)
43431. Run ` basexserver -S`
4444
4545# # API specification
@@ -55,40 +55,76 @@ There is a test suite using [mocha](http://mochajs.org/)
5555` ` ` bash
5656mocha -R spec test/
5757
58+ [auth] password good
59+ √ should not error
5860
59- Execute info command
60- ✓ should not error
61- ✓ should have reply
61+ [auth] password bad
62+ √ should throw error
6263
63- Send an valid xquery statement: 2+2
64- ✓ It should not error
65- ✓ It should equal 4
64+ [commands] Execute info command
65+ √ should not error
66+ √ should have reply
6667
67- Send an invalid command: 2+
68- ✓ It should error
68+ [commands] Send valid xquery statement: 2+2
69+ √ It should not error
70+ √ It should equal 4
6971
70- Create a database
71- ✓ It should not error
72+ [commands] Send an invalid command: 2+
73+ √ It should error
7274
73- Add a document
74- ✓ It should not error
75+ [commands] Create a database testdb using execute
76+ √ It should not error
7577
76- drop db database
77- ✓ It should not error
78+ [commands] Add a document
79+ √ It should not error
7880
79- drop db database
80- ✓ It should not error
81+ [commands] Add an invalid document
82+ √ It should error
8183
82- Send a xquery and iterate over the result items
83- ✓ It should not error
84- ✓ It should return an array
84+ [commands] drop db testdb
85+ √ It should not error
8586
86- create query and bind
87- ✓ It should not error
88- ✓ It should return a string
87+ [commands] create database
88+ √ It should not error
8989
90- 13 tests complete (408 ms)
90+ [commands] drop db database
91+ √ It should not error
9192
93+ [parser] Parser test?
94+ √ should pop abc
95+
96+ [query] create query and bind
97+ √ It should not error
98+ √ It should return a string
99+
100+ [query] create query and bind with type
101+ √ It should not error
102+ √ It should return a string
103+
104+ [query] Send a xquery and iterate over the result items
105+ √ It should not error
106+ √ It should return an array
107+
108+ [stream] Create a database testdb from stream
109+ √ It should not error
110+
111+ [stream] Add doc from stream
112+ √ It should not error
113+
114+ [stream] drop db testdb
115+ √ It should not error
116+
117+ [stress] Send a xquery and iterate over the 1000000 result items
118+ √ should not error
119+
120+ [stress] return megabyte result from execute
121+ √ should not error
122+
123+ [stress] return megabyte result from query
124+ √ should not error
125+
126+
127+ 26 passing (2s)
92128` ` `
93129# Tools
94130
@@ -104,8 +140,8 @@ Thanks to:
104140
105141- [jesseclark](https://github.com/jesseclark)
106142- [Zearin](https://github.com/Zearin)
107-
108-
143+ - [Zearin](https://github.com/Zearin)
144+ - [salim-dev](https://github.com/salim-dev)
109145
110146# Todo
111147 * stream i/o
@@ -123,7 +159,3 @@ Parts inspired by [node_redis](https://github.com/mranney/node_redis),
123159# License
124160
125161BSD license
126-
127-
128- [! [Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/apb2006/basex-node/trend.png)](https://bitdeli.com/free " Bitdeli Badge" )
129-
0 commit comments