mdbtools-node v1.1.0
mdbtools-node
A very small Node wrapper on top of mdbtools
.
Caveat
This module will currently only install and operate in x64 Linux, Windows, and macOS environments.
Usage
import { MDBTools } from "mdbtools";
const database = new MDBTools("pathToDatabase");
No data is read upon construction of the object, only on-demand for each method call. The constructor method only exists to reduce duplication of the table path argument between operations.
Get table names (array of strings):
const tableNames = await database.tableNames();
Get table data (array of objects):
const rows = await database.rows("Table Name");
You can also use the functions directly via the default export, although this method may be removed in future major versions. For example:
import mdbtools from "mdbtools";
const rows = await mdbtools.rows("pathToDatabase", "Table Name");
License
Released under GPLv2, as it includes a submodule with pre-built mdbtools
binaries. At the time of writing, the included portions of mdbtools
use the GPLv2 license. You'll find a source code archive and applicable license file under mdbtools-binaries/
.
Development
After cloning, run git submodule update --init
to pull down the latest supported mdbtools
binaries from this repo. The module won't work without them!
Tests are run with mocha
, with these scripts:
npm run build-test
does a quick incremental TypeScript build and then runs the tests.npm run prepare
cleans out the build data, formats the code, does a full TypeScript build, and runs the tests.
To test the module if there's an updated set of mdbtools
binaries available: npm run update-mdbtools
stashes any changes in the submodule directory and runs git pull
.
Credits
JET4.accdb
, originallynode-adodb.mdb
from thenode-adodb
project.The MIT License (MIT) Copyright (c) 2015 nuintun Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.