This is the Node.js driver for Amazon Quantum Ledger Database (QLDB), which allows Node.js developers to write software that makes use of Amazon QLDB.
For getting started with the driver, see Node.js and Amazon QLDB.
See Accessing Amazon QLDB for information on connecting to AWS.
The JavaScript AWS SDK needs to have AWS_SDK_LOAD_CONFIG
environment variable set to a truthy value in order to read
from the ~/.aws/config
file.
See Setting Region page for more information.
Development of the driver requires TypeScript 3.8.x. It will be automatically installed as a dependency. It is also recommended to use TypeScript when using the driver. Please see the link below for more detail on TypeScript 3.8.x:
Please see the Quickstart guide for the Amazon QLDB Driver for Node.js.
To use the driver, in your package that wishes to use the driver, run the following:
npm install amazon-qldb-driver-nodejs
The driver also has @aws-sdk/client-qldb-session, ion-js and jsbi as peer dependencies. Thus, they must also be dependencies of the package that will be using the driver as a dependency.
npm install @aws-sdk/client-qldb-session
npm install ion-js
npm install jsbi
Then from within your package, you can now use the driver by importing it. This example shows usage in TypeScript specifying the QLDB ledger name and a specific region:
import { QLDBSessionClientConfig } from "@aws-sdk/client-qldb-session";
import { QldbDriver } from "amazon-qldb-driver-nodejs";
const testServiceConfigOption: QLDBSessionClientConfig = {
region: "us-east-1"
};
const qldbDriver: QldbDriver = new QldbDriver("testLedger", testServiceConfigOptions);
qldbDriver.getTableNames().then(function(tableNames: string[]) {
console.log(tableNames);
});
To install the dependencies for the driver, run the following in the root directory of the project:
npm install
To build the driver, transpiling the TypeScript source code to JavaScript, run the following in the root directory:
npm run build
You can run the unit tests with this command:
npm test
or
npm run testWithCoverage
You can run the integration tests with this command:
npm run integrationTest
This command requires that credentials are pre-configured and it has the required permissions.
Additionally, a region can be specified in: src/integrationtest/.mocharc.json
.
TypeDoc is used for documentation. You can generate HTML locally with the following:
npm run doc
Please use these community resources for getting help.
If you encounter a bug with the Amazon QLDB Node.js Driver, we would like to hear about it. Please search the existing issues and see if others are also experiencing the issue before opening a new issue. When opening a new issue, we will need the version of Amazon QLDB Node.js Driver, Node.js language version, and OS you’re using. Please also include reproduction case for the issue when appropriate.
The GitHub issues are intended for bug reports and feature requests. For help and questions with using AWS QLDB Node.js Driver please make use of the resources listed in the Getting Help section. Keeping the list of open issues lean will help us respond in a timely manner.
This library is licensed under the Apache 2.0 License.
Generated using TypeDoc