Registry / database / athena-express

athena-express

JSON →
library7.1.5jsnpmunverified

Athena-Express is a Node.js wrapper around the AWS SDK for Amazon Athena that simplifies executing SQL queries and fetching clean JSON results. It handles query initiation, polling for completion, result retrieval from S3, and error retries for throttling/network errors. Supports pagination and streaming, with optional cost reporting. Currently at v7.1.5, ships TypeScript types. Differentiators: synchronous/asynchronous fetch, automatic error handling, and a single-call API vs. manual AWS SDK orchestration. Release cadence is irregular; latest update 2021.

npm install athena-express
INSTALL
IMPORT
SIG · ATHENA-EXPRESS
A
athena-express
databasejavascriptv7.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

athenaExpress
import athenaExpress from 'athena-express'
const { athenaExpress } = require('athena-express')
Default export, not named. CJS require works but named destructure is common mistake.
AthenaExpressConfig
import { AthenaExpressConfig } from 'athena-express'
None
TypeScript type for configuration object.
QueryResult
import { QueryResult } from 'athena-express'
None
TypeScript type for query result.

Initializing Athena-Express with AWS credentials, executing a SQL query, and logging results including cost.

import athenaExpress from 'athena-express'; import AWS from 'aws-sdk'; const awsConfig = { region: process.env.AWS_REGION ?? 'us-east-1', accessKeyId: process.env.AWS_ACCESS_KEY_ID ?? '', secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY ?? '' }; const athena = new AWS.Athena(awsConfig); const config = { aws: athena, s3: 's3://my-athena-results-bucket/', getStats: true }; const client = new athenaExpress(config); async function runQuery() { const result = await client.query('SELECT * FROM my_database.my_table LIMIT 10;'); console.log(result.Items); console.log('Query cost:', result.Cost); } runQuery();
Debug
Known issues
gotchaRequires AWS SDK v2; not compatible with v3 (@aws-sdk/client-athena)
fix
Use aws-sdk v2 or fork/update library to support v3.
affects: >=7.0.0
gotchaMust provide S3 bucket for query results via s3 config or environment variable
fix
Set s3 config key or ensure Athena workgroup has result location set.
affects: *
deprecatedgetStats option may be deprecated; cost calculation uses outdated pricing
fix
Use athena-express v5 for stable stats or manually calculate cost.
affects: >=6.0.0
gotchaDefault import exports a constructor, not a namespace object
fix
Use default import and then instantiate: new athenaExpress(config).
affects: *
Errors
Common errors & fixes
TypeError: athenaExpress is not a constructor
Using named import { athenaExpress } instead of default import
fix
Change to import athenaExpress from 'athena-express'
MissingRegionError: Missing required key 'region' in params
AWS config missing region
fix
Set AWS region in aws-sdk config or environment variable AWS_REGION
Error: Cannot find module 'aws-sdk'
aws-sdk is not installed or not declared
fix
Run npm install aws-sdk
Upgrade
Version history
7.1.5latest on npm
Audit
Dependencies
aws-sdkrequiredUsed to interact with Athena and S3 APIs
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
athena-express — npm install athena-express · libregistry