You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

basex

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

basex

A BaseX (XML database) client library

0.6.2
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

basex - A BaseX client for node.js

===========================

This is BaseX client for Node.js. It is work in progress. It uses the client interface via a socket connection to the BaseX server.

BaseX is a very light-weight, high-performance and scalable XML Database engine and XPath/XQuery 3.0 Processor, including full support for the W3C Update and Full Text extensions. Built as a lightweight Java server, BaseX also supports XSLT, Webdav and RestXQ.

Installing the BaseX Node client

To install with npm:

npm install basex

	$ mkdir myproject
	cd myproject
	$ npm install basex
	basex@0.6.0 ./node_modules/basex 

Once BaseX is installed and the BaseX server is running, test it.

	$ cd examples/
	$ node Example.js 
	milliseconds: 0
	{ result: '1 2 3 4 5 6 7 8 9 10',
	  info: '\nQuery executed in 0.38 ms.\n' }
	end
	close

Installing BaseX

  • Java is required
  • Download and install BaseX (tested against version 7.6)
  • Run basexserver -S

API specification

See commands.md in the docs folder for details of the API.

Tests

There is a test suite using mocha , should and sinon.

mocha -R spec test/test-commands.js 


  Execute info command
    ✓ should not error 
    ✓ should have reply 

  Send an valid xquery statement:  2+2
    ✓ It should not error 
    ✓ It should equal 4 

  Send an invalid command:  2+
    ✓ It should  error 

  Create a database
    ✓ It should not error 

  Add a document
    ✓ It should not error 

  drop db database
    ✓ It should not error 

  drop db database
    ✓ It should not error 

  Send a xquery and iterate over the result items
    ✓ It should not error 
    ✓ It should return an array 

  create query and bind 
    ✓ It should not error 
    ✓ It should return a string 

  13 tests complete (408 ms)

TODO

  • stream i/o
  • reconnect

Inspiration

Parts inspired by node_redis, BaseX Java client

#license

BSD license

Keywords

xml

FAQs

Package last updated on 23 Jul 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts