npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@architect/asap

v7.0.10

Published

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

Downloads

22,103

Readme

@architect/asap

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

GitHub CI status

Usage

Module

Call ASAP within your handler function manually like so:

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