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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aligent/cdk-cloudfront-security-headers

v0.5.1

Published

A Cloudfront Lambda@Edge function for adding security headers.

Readme

AWS CDK CloudFront Security Headers

TypeScript version AWS CDK version NPM version

This package contains a Lambda@Edge function for Cloudfront to add security headers to the origin response of all requests.

The function is intended to be added to an existing Cloudfront.

Usage and Default Options

contentSecurityPolicy (array<string>, optional)

  • Array to store content security policies to attach

Security headers attached

headers["strict-transport-security"] (aka HSTS)

  • Informs browsers that the site should only be accessed using a HTTPS connection.

Value Directives:

  • max-age=<expire-time> (seconds):

    • Time is set to 108000s seconds / 30 hours. Specifies the length of time the browser should remember that site can only be accessed using HTTPS
  • includeSubdomains (boolean, optional):

    • Option is specifcied. The rule will apply to all of the site's subdomains
  • preload (boolean, optional):

    • Option is specificed. The will be preloaded into the HSTS Preload List.

    • The Preload List is a list built into major web browsers like Chromium, Edge and Firefox. It is a list containing domains that HTTPS enforcement is automatically applied before the browser receives the STS header.

    • This soves the first-load problem of a browser not knowing a site's HSTS policy before the user has visited the site for a first time.

headers["content-security-policy"]

  • Allows control over resources that the user agent is allowed to load for a given page. CSPs help guard agaisnt cross-site scripting attacks.

Value:

  • __CONTENT_SECURITY_POLICY__:
    • Defined as an option in index.ts. See Usage and Default Options above.

headers["x-content-type-options"]

  • Indicates that the MIME types advertised in the Content-Type headers should be respected and not changed.

Value:

  • nosniff (boolean):
    • Option is specified. Blocks a request if request destination is of type style and the MIME type is not test/css or of type script and the MIME type is not a JavaScript MIME type.

headers["x-frame-options"]

  • Indicates whether a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>. Helps to avoid clickjacking attacks by ensuring content is not embedded into other sites.

Value Directives:

  • DENY(boolean, optional):

    • Option is specified. The page cannot be displayed in a frame, regardless of the site attempting to do so.
  • SAMEORIGIN(boolean, optional):

    • The page can only be displayed if all ancestor frames are same origin to the page itself.