• Stars
    star
    231
  • Rank 173,434 (Top 4 %)
  • Language
    JavaScript
  • Created over 1 year ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple, fast, extensible AWS client

aws-lite

aws-lite is simple, extremely fast, extensible Node.js client for interacting with AWS services.

(It's got good error reporting, too.)

You can think of it as a community-driven alternative to AWS's JavaScript SDK.

GitHub CI status npm version Apache-2.0 License


Who made this?

aws-lite is developed and maintained by the folks at OpenJS Foundation Architect. We <3 AWS!

So, what is aws-lite?

aws-lite is a simple, extremely fast, extensible Node.js client for interacting with AWS services.

(It's got good error reporting, too.)

You can think of it as a community-driven alternative to AWS's JavaScript SDK.

Why not use aws-sdk / @aws-sdk/*?

Amazon has historically done a great job of maintaining its SDKs. However, AWS has deprecated its widely-adopted v2 SDK; its v3 SDK relies on generated code, resulting in large dependencies, poor performance, awkward semantics, difficult to understand documentation, and errors without usable stack traces.

We rely on and believe in AWS, so we built aws-lite to provide a simpler, faster, more stable position from which to work with AWS services in Node.js.

Features

  • 2-5x faster than AWS SDK v3
  • Simple semantics & straightforward promise-based interface
  • Human-readable documentation
  • Customizable
  • Errors with stack traces and line numbers
  • Built-in pagination
  • Secured with AWS Signature v4
  • Interacts with any AWS service without needing any plugins
  • Automatically parses / serializes JSON, AWS-flavored JSON, and XML request / response payloads
  • Easily integrates with local testing suites and AWS service mocks
  • Use existing service plugins, or develop your own
  • Debug mode for inspecting raw requests and responses
  • Just two dependencies

Install aws-lite

Install the client:

npm i @aws-lite/client

You can use the client as-is to quickly interact with AWS service APIs, or extend it with specific service plugins like so:

npm i @aws-lite/dynamodb

Generally, types are available as optional @aws-lite/*-types packages, and can be added like so:

npm i -D @aws-lite/dynamodb-types

Learn more about aws-lite types.

Example

Now start making calls to AWS:

/**
 * Instantiate a client
 * This is an asynchronous operation that will attempt to load your AWS credentials, local configuration, region settings, etc.
 */
import awsLite from '@aws-lite/client'
const config = { region: 'us-west-1' } // Optional
const aws = await awsLite(config)

/**
 * Reads
 * Fire a GET request to the Lambda API by specifying its AWS service name and endpoint
 */
await aws({
  service: 'lambda',
  endpoint: '/2015-03-31/functions/$function-name/configuration',
})
// {
//   FunctionName: '$function-name',
//   Runtime: 'nodejs20.x',
//   ...
// }

/**
 * Writes
 * POST JSON by adding a `payload` property
 */
await aws({
  service: 'lambda',
  endpoint: '/2015-03-31/functions/$function-name/invocations',
  payload: { ok: true },
})

/**
 * Plugins
 * Use service plugins to more easily interact with the AWS services your application relies on
 */
await aws.DynamoDB.GetItem({
  pk: '$item-key',
})
// {
//   Item: {
//     pk: '$item-key',
//     data: 'item-data',
//     ...
//   }
// }

Learn more

Client configuration

Credential and general configuration options for aws-lite

Requests / responses

Using aws-lite to make requests and receiving responses

Using TypeScript

Guide and examples for using TypeScript with aws-lite

Plugin API

Docs and examples for the aws-lite plugin API

Performance

Open, reproducible, real-world metrics for the performance of aws-lite and other AWS SDKs

Contributing

Open source contributor guidelines, methodology, and instructions

List of official @aws-lite/* plugins

More Repositories

1

architect

The simplest, most powerful way to build a functional web app (fwa)
JavaScript
2,485
star
2

dynalite

An implementation of Amazon's DynamoDB built on LevelDB
JavaScript
1,032
star
3

arc.codes

The Architect web site! 🌩
JavaScript
312
star
4

functions

AWS Lambda Node runtime helpers for Architect apps
JavaScript
160
star
5

sandbox

Architect dev server: run full Architect projects locally & offline in a sandbox
JavaScript
35
star
6

tap-arc

Node.js spec-like TAP reporter
JavaScript
29
star
7

examples

Architect example applications and cloud function development patterns
21
star
8

data

[deprecated] Generate a DynamoDB data access layer from an .arc file. Automatically disambiguates testing (in memory) from deployment staging and production tables
JavaScript
21
star
9

parser

arc.app, .arc, arc.json, arc.yaml, and arc.toml support
JavaScript
20
star
10

plugin-typescript

TypeScript custom runtime + workflow integration for Architect
JavaScript
14
star
11

functions-python

AWS Lambda Python runtime helpers for Architect apps
Python
13
star
12

plugin-remix

Architect plugin for Remix.
JavaScript
11
star
13

sveltekit-adapter

Svelte
10
star
14

arcdown

A small stack of Markdown tools configured using some preferred conventions for creating technical content rendered and served from a cloud function.
JavaScript
10
star
15

aws-lite-performance

JavaScript
10
star
16

plugins

List of Architect plugins by the community + maintainers
9
star
17

vim-plugin

Official Vim plugin for Architect, including syntax highlighting for the Architect file format (app.arc, .arc, config.arc, and prefs.arc)
Vim Script
6
star
18

deploy

Deployment module for shipping @architect projects to the cloud
JavaScript
6
star
19

create

Module to bootstrap Architect projects, and idempotently create new project resources
JavaScript
6
star
20

plugin-lambda-invoker

Interactively invoke Lambdas in Architect Sandbox with arbitrary events
JavaScript
5
star
21

functions-deno

JavaScript
4
star
22

package

Package .arc apps for deployment with Cloudformation
JavaScript
4
star
23

env

Manage an Architect project's environment variables
JavaScript
4
star
24

macro-http-api

[DEPRECATED] HTTP APIs are now the default in Architect 7+!
JavaScript
4
star
25

macro-upload

A macro for creating an S3 bucket for processing direct uploads with a Lambda function
JavaScript
4
star
26

plugin-budget-watch

Monitor app spend and stop lambdas when the limit is reached
JavaScript
4
star
27

logs

manage @architect Function logs
JavaScript
3
star
28

inventory

Architect project resource enumeration utility
JavaScript
3
star
29

plugin-storage-private

Architect serverless framework macro that defines any number of arbitrary private S3 buckets
JavaScript
3
star
30

hydrate

Architect dependency hydrator and shared file manager
JavaScript
3
star
31

lambda-runtimes

Canonical list of AWS Lambda runtime identifiers and corresponding CPU architectures
JavaScript
3
star
32

vscode-extension

Official VS Code extension for Architect, including syntax highlighting for the Architect file format (app.arc, .arc, config.arc, and prefs.arc)
2
star
33

asap

Architect HTTP proxy distribution, extracted from @architect/functions (arc.http.proxy)
JavaScript
2
star
34

utils

Common utilities for Architect modules
JavaScript
2
star
35

sublime-package

Official Sublime Text package for Architect, including syntax highlighting for the Architect file format (app.arc, .arc, config.arc, and prefs.arc)
JavaScript
1
star
36

functions-ruby

AWS Lambda Ruby runtime helpers for Architect apps
Ruby
1
star
37

req-res-fixtures

API Gateway request/response fixtures for testing in various Architect libraries
JavaScript
1
star
38

plugin-storage-public

Architect serverless framework macro that defines any number of arbitrary public S3 buckets
JavaScript
1
star
39

plugin-external-tables

Enable access to external DynamoDB tables from other Architect projects, legacy Architect projects, and non-Architect projects
JavaScript
1
star
40

plugin-rust

Rust runtime + workflow integration for Architect
JavaScript
1
star
41

macro-proxy

[DEPRECATED] Use `@proxy` built into Architect 8+!
JavaScript
1
star
42

plugin-node-prune

Architect plugin that cleans `node_modules` cruft from your cloud functions during deployment
Shell
1
star
43

macro-node-prune

[DEPRECATED] Please use `@architect/plugin-node-prune`
Shell
1
star
44

repl

creates a REPL for testing Architect projects
JavaScript
1
star
45

plugin-go

Go runtime + workflow integration for Architect
JavaScript
1
star
46

action-build

1
star
47

aws-lite.org

JavaScript
1
star
48

plugin-rest-api

Legacy API Gateway REST API plugin for @architect projects
JavaScript
1
star
49

action-deploy

1
star