Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/architect/functions
AWS Lambda Node runtime helpers for Architect apps
https://github.com/architect/functions
Last synced: 1 day ago
JSON representation
AWS Lambda Node runtime helpers for Architect apps
- Host: GitHub
- URL: https://github.com/architect/functions
- Owner: architect
- Created: 2017-07-20T00:33:19.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-08-17T21:25:49.000Z (3 months ago)
- Last Synced: 2024-10-28T15:42:31.790Z (14 days ago)
- Language: JavaScript
- Homepage: https://arc.codes
- Size: 1.74 MB
- Stars: 163
- Watchers: 7
- Forks: 38
- Open Issues: 21
-
Metadata Files:
- Readme: readme.md
- Contributing: .github/contributing.md
- Code of conduct: .github/code_of_conduct.md
Awesome Lists containing this project
README
## [`@architect/functions`](https://www.npmjs.com/package/@architect/functions)
> Runtime utility library for [Functional Web Apps (FWAs)](https://fwa.dev/) built with [Architect][https://arc.codes]
[![GitHub CI status](https://github.com/architect/functions/workflows/Node%20CI/badge.svg)](https://github.com/architect/functions/actions?query=workflow%3A%22Node+CI%22)
Check out the full docs for [this library](https://arc.codes/docs/en/reference/runtime-helpers/node.js) and [Architect](https://arc.codes)
## Install
Within your Architect project directory, add `@architect/function` to its root `package.json`:
`npm i @architect/functions`
> You may also add `@architect/function` to individual Lambda `package.json` files, but we suggest making use of Architect's automated Lambda treeshaking. See the [Architect dependency management guide](https://staging.arc.codes/docs/en/guides/developer-experience/dependency-management#node.js) for more details.
## Usage
```js
let {
events, // @events pub/sub
http, // @http middleware + tools
queues, // @queues pub/sub
services, // Architect resource / service discovery
static, // @static asset helper
tables, // @tables DynamoDB helper methods + API client
ws, // @ws WebSocket helper + API client
} = require('@architect/functions')
```# API
**[`@events` methods](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.events)**
- [`events.subscribe()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.events.subscribe())
- [`events.publish()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.events.publish())**[`@http` methods](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.http)**
- [`http()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.http)
- [`http` middleware](https://arc.codes/docs/en/reference/runtime-helpers/node.js#middleware)
- [`http.session`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.http.session)**[`@queues` methods](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.queues)**
- [`queues.subscribe()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.queues.subscribe())
- [`queues.publish()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.queues.publish())**Service discovery**
- [`services()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.services())**[`@static`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.static())**
- [`static()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.static())**[`@tables` methods](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.tables())**
- [`tables()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.tables())
- [`table.delete()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#instance-methods)
- [`table.get()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#instance-methods)
- [`table.put()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#instance-methods)
- [`table.query()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#instance-methods)
- [`table.scan()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#instance-methods)
- [`table.scanAll()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#instance-methods)
- [`table.update()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#instance-methods)
- [`table._db`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#client-methods)
- [`table._doc`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#client-methods)
- [`table.name`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#client-methods)
- [`table.reflect()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#client-methods)**[`@ws` methods](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.ws)**
- [`ws.send()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.ws.send())
- [`ws.close()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.ws.close())
- [`ws.info()`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.ws.info())
- [`ws._api`](https://arc.codes/docs/en/reference/runtime-helpers/node.js#arc.ws._api())