New BaseX client for nodejs
Wednesday, 13 May 2015 · 6 messages · last reply 17 May 2015
A
alxarch13 May 2015 11:17 #
Hi all,
I am making a new BaseX client for nodejs.
It focuses on utilising node streams in order to be able to pipe data to/from BaseX directly. (i.e. pipe request body to an ADD command or pipe XQuery output to a response). It also uses promises for more code flow flexibility.
Features:
- Supports streams where appropriate (command output, query execution, add, store etx)
- Promises interface
I plan to release it in NPM within the week (It lacks proper documentation and I want to organise my tests as mocha tests).
Alex
A
alxarch13 May 2015 11:27 #
Sorry,
I hit enter by mistake and gmail sent before I finished listing the current features and adding a link
Hi all,
I am making a new BaseX client for nodejs
<https://github.com/alxarch/basex-stream>.
It focuses on utilising node streams in order to be able to pipe data to/from BaseX directly. (i.e. pipe request body to an ADD command or pipe XQuery output to a response). It also uses promises for more code flow flexibility.
Current features:
- Supports streams where appropriate (command output, query execution, add, store etc)
- Promises interface
- Query results available as they come
- Events monitor support
Planned features:
- Simple utils (ie db info retrieval, repo management)
- Database OOP (ie
db('test').then(function (db) { db.backup()})
- Result type conversion
- Built-in support for json results (ie parse json response on-the-fly)
I plan to release it in NPM within the week (It lacks proper documentation and I want to organise my tests as mocha tests).
AlexQuoted text · alxarch · 21 lines
On 13 May 2015 at 12:17, alxarch <alxarch at gmail.com> wrote: > Hi all, > > I am making a new BaseX client for nodejs. > It focuses on utilising node streams in order to be able to pipe > data to/from BaseX directly. (i.e. pipe request body to an ADD command > or pipe XQuery output to a response). It also uses promises for more > code flow flexibility. > > Features: > > - Supports streams where appropriate (command output, query execution, > add, store etx) > - Promises interface > > > I plan to release it in NPM within the week (It lacks proper > documentation and I want to organise my tests as mocha tests). > > Alex >
CG
Christian Grün13 May 2015 11:34 #
Hi Alex,
Quoted text · alxarch · 1 line
> I am making a new BaseX client for nodejs.
That's nice to hear, thanks for the update!
Quoted text · alxarch · 2 lines
> I hit enter by mistake and gmail sent before I finished listing the current > features and adding a link
A little hint: I activated the "undo send" lab feature in GMail. The only problem is that I'm now frequently using this feature instead of properly reading my mail first..
C.
Quoted text · alxarch · 52 lines
> > Hi all, > > I am making a new BaseX client for nodejs. > It focuses on utilising node streams in order to be able to pipe > data to/from BaseX directly. (i.e. pipe request body to an ADD command > or pipe XQuery output to a response). It also uses promises for more > code flow flexibility. > > Current features: > > - Supports streams where appropriate (command output, query execution, > add, store etc) > - Promises interface > - Query results available as they come > - Events monitor support > > Planned features: > > - Simple utils (ie db info retrieval, repo management) > - Database OOP (ie `db('test').then(function (db) { db.backup()})` > - Result type conversion > - Built-in support for json results (ie parse json response on-the-fly) > > I plan to release it in NPM within the week (It lacks proper > documentation and I want to organise my tests as mocha tests). > > Alex > > On 13 May 2015 at 12:17, alxarch <alxarch at gmail.com> wrote: >> >> Hi all, >> >> I am making a new BaseX client for nodejs. >> It focuses on utilising node streams in order to be able to pipe >> data to/from BaseX directly. (i.e. pipe request body to an ADD command >> or pipe XQuery output to a response). It also uses promises for more >> code flow flexibility. >> >> Features: >> >> - Supports streams where appropriate (command output, query execution, >> add, store etx) >> - Promises interface >> >> >> I plan to release it in NPM within the week (It lacks proper >> documentation and I want to organise my tests as mocha tests). >> >> Alex > >
A
Hi all,
I released my new BaseX client for nodeJS
https://www.npmjs.com/package/basex-stream
It's currently in a usable state.
I need to document and test some more.
The source is in Literate CoffeeScript so documentation is visible in-place in github.
The functionality will expand as new needs arise while using the library in my projects.
I am hopeful that this client will be better maintained than my basex-php composer package
since I use node and coffeescript on a daily basis, so I will have motive tocontinue work on it.
Cheers,
Alex
AB
Andy Bunce17 May 2015 18:35 #
Hi Alex,
Looks good and certainly cleaner than my effort :-). Literate CoffeeScript is new to me but, having struggled with asynchrous stream parsing in node, I do like the look of
https://github.com/alxarch/basex-stream/blob/master/src/parser.litcoffee .I hope to give it try soon.
Cheers
/Andy
Quoted text · alxarch · 22 lines
On 17 May 2015 at 16:47, alxarch <alxarch at gmail.com> wrote: > Hi all, > > I released my new BaseX client for nodeJS > > https://www.npmjs.com/package/basex-stream > > > It's currently in a usable state. > I need to document and test some more. > The source is in Literate CoffeeScript so documentation is visible > in-place in github. > The functionality will expand as new needs arise while using the library > in my projects. > I am hopeful that this client will be better maintained than my basex-php > composer package > since I use node and coffeescript on a daily basis, so I will have motive > tocontinue work on it. > > Cheers, > Alex >
A
alxarch17 May 2015 18:45 #
Hi Andy,
Thanks, I just fixed events monitoring too (v0.1.1).
It appears that using node's Transform stream classes and combining them via pipes allows
much cleaner code overall. I am new to Literate CoffeeScript also but using it in this package
helped me understand the way my code would work when using it and have a unified interface.
Cheers,
Alex
Written for BaseX 8.1. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery