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

adapter-foundry

v1.0.3

Published

SvelteKit adapter for CrowdStrike Foundry — prerenders your app and rewrites asset paths to relative URLs for Foundry's sandboxed iframe environment

Readme

adapter-foundry

A SvelteKit adapter for CrowdStrike Foundry that prerenders your app as static files and rewrites asset paths so they resolve correctly inside Foundry's sandboxed iframe environment.

Why this exists

SvelteKit's static adapter emits absolute asset paths in generated HTML and JS, for example:

<script src="/_app/immutable/entry/start.abc123.js"></script>

Inside Foundry's iframe, your app is served from a UUID-prefixed URL:

https://falcon.us-2.crowdstrike.com/foundry/page/<uuid>?path=<path>

In the example above, <uuid> is the unique identifier for your Foundry application and <path> is the internal route within your application.

An absolute /_app/... path resolves against the root of the Foundry domain instead of your app bundle directory, so every asset 404s. This adapter post-processes the build output to rewrite every /_app/ reference to ./_app/, which resolves correctly relative to wherever index.html is served from.

Installation

npm install --save-dev adapter-foundry
# or
pnpm add -D adapter-foundry

Note: If using TypeScript, ensure your tsconfig.json sets "moduleResolution": "bundler" to correctly resolve Svelte modules.

Usage

// svelte.config.js
import adapter from 'adapter-foundry';

export default {
  kit: {
    // Zero-config for Foundry — nothing else required.
    // The fallback page is generated automatically when router.type is 'hash'.
    // SSR and prerender do not need to be configured.
    adapter: adapter(),
    router: { type: 'hash' },
  },
};

[!IMPORTANT] Hash routing is required for Foundry to work correctly. While the project will build correctly, it will not work with Foundry.

All options are optional. The only reason to pass options is if you need a non-default output directory or compression.

// svelte.config.js — explicit options shown for reference
import adapter from 'adapter-foundry';

export default {
  kit: {
    adapter: adapter({
      pages:       'build',
      assets:      'build',       // defaults to the value of pages
      fallback:    'index.html',  // auto-set when router.type is 'hash'
      precompress: false,
      strict:      true,
    }),
    router: { type: 'hash' },
  },
};

Options

All options are optional.

| Option | Type | Default | Description | |---|---|---|---| | pages | string | 'build' | Directory to write prerendered pages to | | assets | string | value of pages | Directory to write client-side assets to | | fallback | string | 'index.html' when hash routing, otherwise unset | Filename of the SPA fallback page. Auto-set when router.type is 'hash' | | precompress | boolean | false | Generate .gz and .br compressed asset files | | strict | boolean | true | Throw if any routes are not fully prerenderable. Ignored in hash-router mode |

How the path rewriting works

After the standard static build pipeline runs, the adapter walks all .html and .js files in the output directory and applies three regex substitutions:

| Pattern | Example input | Example output | |---|---|---| | HTML attribute values | src="/_app/..." | src="./_app/..." | | JS / JSON string literals | "/_app/..." | "./_app/..." | | Bare ES module specifiers | import("/_app/...") | import("./_app/...") |

Each substitution is anchored to a preceding delimiter (quote character, whitespace, or open punctuation) to avoid false positives on unrelated content.

Relationship to @sveltejs/adapter-static

This adapter is a thin post-processing wrapper around the same build pipeline that @sveltejs/adapter-static uses. It supports the same AdapterOptions interface and performs identical validation. The only additional step is the /_app/ path rewriting pass that runs after the build completes.

Development

# Install dependencies
npm install

# Type-check
npm run check

# Run tests
npm test

# Build (compiles TypeScript to dist/)
npm run build

Changelog

See CHANGELOG.md.

License

MIT — Mullaney Strategic Systems LLC


CrowdStrike and Falcon are trademarks or registered trademarks of CrowdStrike, Inc. in the United States and other countries. This project is not affiliated with, sponsored by, or endorsed by CrowdStrike, Inc.