
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
===========================
This is a BaseX client for Node.js. 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.
To install with npm:
npm install basex
$ mkdir myproject
cd myproject
$ npm install basex
basex@1.0.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
basexserver -S
See commands.md in the docs folder for details of the API.
There is a test suite using mocha , should and sinon.
mocha test
[auth] password good
β should not error
[auth] password bad
β should throw error
[commands] Execute info command
β should not error
β should have reply
[commands] Send valid xquery statement: 2+2
β It should not error
β It should equal 4
[commands] Send an invalid command: 2+
β It should error
[commands] Create a database testdb using execute
β It should not error
[commands] Add a document
β It should not error
[commands] Add an invalid document
β It should error
[commands] drop db testdb
β It should not error
[commands] create database
β It should not error
[commands] drop db database
β It should not error
[parser] Parser test?
β should pop abc
[query] create query and bind
β It should not error
β It should return a string
[query] create query and bind with type
β It should not error
β It should return a string
[query] Send a xquery and iterate over the result items
β It should not error
β It should return an array
[stream] Create a database testdb from stream
β It should not error
[stream] Add doc from stream
β It should not error
[stream] drop db testdb
β It should not error
[stress] Send a xquery and iterate over the 1000000 result items
β should not error
[stress] return megabyte result from execute
β should not error
[stress] return megabyte result from query
β should not error
26 passing (2s)
Javascript is formated using js-beautify js-beautify -r index.js
Documentation is generated using jsdoc -r -d docs --verbose index.js
Anyone is welcome to submit issues and pull requests
Thanks to:
Parts inspired by node_redis, BaseX Java client
BSD license
FAQs
A BaseX (XML database) client library
We found that basex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NISTβs handling of the National Vulnerability Database.
Research
Security News
Socketβs Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.