npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

amazon-qldb-driver-nodejs

v3.1.0

Published

The Node.js driver for working with Amazon Quantum Ledger Database

Downloads

38,055

Readme

Amazon QLDB Node.js Driver

NPM Version Documentation license AWS Provider

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.

Requirements

Basic Configuration

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.

TypeScript 3.8.x

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:

Getting Started

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

Note: For using version 3.0.0 and above of the driver, the version of the aws-sdk should be >= 3.x

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);
});

See Also

  1. Getting Started with Amazon QLDB Node.js Driver: A guide that gets you started with executing transactions with the QLDB Node.js driver.
  2. QLDB Node.js Driver Cookbook The cookbook provides code samples for some simple QLDB Node.js driver use cases.
  3. Amazon QLDB Node.js Driver Tutorial: In this tutorial, you use the QLDB Driver for Node.js to create an Amazon QLDB ledger and populate it with tables and sample data.
  4. Amazon QLDB Node.js Driver Samples: A DMV based example application which demonstrates how to use QLDB with the QLDB Driver for Node.js.
  5. QLDB Node.js driver accepts and returns Amazon ION Documents. Amazon Ion is a richly-typed, self-describing, hierarchical data serialization format offering interchangeable binary and text representations. For more information read the ION docs.
  6. Amazon QLDB supports the PartiQL query language. PartiQL provides SQL-compatible query access across multiple data stores containing structured data, semistructured data, and nested data. For more information read the PartiQL docs.
  7. Refer the section Common Errors while using the Amazon QLDB Drivers which describes runtime errors that can be thrown by the Amazon QLDB Driver when calling the qldb-session APIs.

Development

Setup

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

Running Tests

You can run the unit tests with this command:

npm test

or

npm run testWithCoverage

Integration Tests

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.

Documentation

TypeDoc is used for documentation. You can generate HTML locally with the following:

npm run doc

Getting Help

Please use these community resources for getting help.

Opening Issues

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.

License

This library is licensed under the Apache 2.0 License.