open-index/open-npm huggingface dataset:
npm package: @architect/asap
Description: Architect Static Asset Proxy (ASAP) - a helpful library for Lambda-based static asset delivery
Latest version: 7.0.10

# @architect/asap

>  Architect Static Asset Proxy (ASAP) - a helpful library for Lambda-based static asset delivery

[![GitHub CI status](https://github.com/architect/asap/workflows/Node%20CI/badge.svg)](https://github.com/architect/asap/actions?query=workflow%3A%22Node+CI%22)

# Usage

## Module

Call ASAP within your handler function manually like so:

```javascript
let asap = require('@architect/asap')

// All config is optional!
module.exports = asap({
  // Alias assets to different filenames
  alias: {
    '/an-asset.jpg': '/a-different-filename.jpg',
    '/a-path': '/a-different-path',
  },
  // Pass your own fingerprinted static asset manifest (defaults to Arc-generated static.json)
  assets: { 'some-file.gif': 'some-file-a1b2c3.gif' },
  // Set a custom bucket configuration (defaults to Arc-generated buckets)
  bucket: {
    staging: 'staging-bucket-name',
    production: 'production-bucket-name',
    folder: 'some-bucket-subfolder',
  },
  // Override the content-aware cache-control header
  cacheControl: 'max-age=0',
  // Manually set response headers
  headers: { 'some-header': 'ok=true' },
  // Return null if asset is not found (defaults to `false`)
  passthru: true,
  // Engage SPA mode (defaults to `false`)
  spa: false,
})
```


## Lambda handler

Use ASAP as the handler for your Lambda! If you're using Architect, this is done automatically for you when you don't define a root handler for your `@http` pragma.

If using ASAP with non-Architect projects, just point your Lambda's source directory to `src/`, and make sure you set the following two env vars:
- `ARC_ENV`: `staging` or `production`
- `ARC_STATIC_BUCKET`: the S3 bucket name where your assets are stored
npm package: @architect/package
Description: Package .arc for deployment with CloudFormation
Author: Brian LeRoux
Latest version: 11.0.4

# `@architect/package` [![GitHub CI status](https://github.com/architect/package/workflows/Node%20CI/badge.svg)](https://github.com/architect/package/actions?query=workflow%3A%22Node+CI%22)
<!-- [![codecov](https://codecov.io/gh/architect/package/branch/master/graph/badge.svg)](https://codecov.io/gh/architect/package) -->

[@architect/package][npm] packages @architect projects as [`AWS::Serverless`][sam]-compatible JSON. Converts Architect projects into a [AWS Serverless Application Model (SAM)][sam]-compatible format.

## Install

    npm i @architect/package

## API

All of this module's methods take as input an [@architect/inventory][inventory]-parsed Architect project.

### pkg(arc)

## Example Usage

```javascript
let inventory = require('@architect/inventory')
let pkg = require('@architect/package')

// fake out an .arc file as a string
let arcString = `
@app
mybasicapp

@http
get /
`

// export as sam
let inv = await inventory({ rawArc: arcString, deployStage: 'staging' })
let sam = pkg(inv)
console.log(sam)
```

[npm]: https://www.npmjs.com/package/@architect/package
[inventory]: https://www.npmjs.com/package/@architect/inventory
[sam]: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template.html