Installations
npm install @architect/asap
Releases
Unable to fetch releases
Developer
architect
Developer Guide
Module System
CommonJS
Min. Node Version
>=16
Typescript Support
No
Node Version
20.12.2
NPM Version
10.5.0
Statistics
3 Stars
799 Commits
5 Forks
5 Watching
1 Branches
12 Contributors
Updated on 29 Sept 2024
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
1,133,326
Last day
4%
1,930
Compared to previous day
Last week
-45.9%
4,970
Compared to previous week
Last month
15.5%
24,642
Compared to previous month
Last year
-21.1%
294,758
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
@architect/asap
Architect Static Asset Proxy (ASAP) - a helpful library for Lambda-based static asset delivery
Usage
Module
Call ASAP within your handler function manually like so:
1let asap = require('@architect/asap') 2 3// All config is optional! 4module.exports = asap({ 5 // Alias assets to different filenames 6 alias: { 7 '/an-asset.jpg': '/a-different-filename.jpg', 8 '/a-path': '/a-different-path', 9 }, 10 // Pass your own fingerprinted static asset manifest (defaults to Arc-generated static.json) 11 assets: { 'some-file.gif': 'some-file-a1b2c3.gif' }, 12 // Set a custom bucket configuration (defaults to Arc-generated buckets) 13 bucket: { 14 staging: 'staging-bucket-name', 15 production: 'production-bucket-name', 16 folder: 'some-bucket-subfolder', 17 }, 18 // Override the content-aware cache-control header 19 cacheControl: 'max-age=0', 20 // Manually set response headers 21 headers: { 'some-header': 'ok=true' }, 22 // Return null if asset is not found (defaults to `false`) 23 passthru: true, 24 // Engage SPA mode (defaults to `false`) 25 spa: false, 26})
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
orproduction
ARC_STATIC_BUCKET
: the S3 bucket name where your assets are stored
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/24 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/build.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/architect/asap/build.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/architect/asap/build.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/architect/asap/build.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:77: update your workflow using https://app.stepsecurity.io/secureworkflow/architect/asap/build.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/architect/asap/build.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:99: update your workflow using https://app.stepsecurity.io/secureworkflow/architect/asap/build.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/build.yml:42
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 10 are checked with a SAST tool
Score
3.1
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More