Skip to main content
Home

Built and signed on GitHub Actions

Works with
This package works with Node.js, Deno, Browsers
This package works with Node.js
This package works with Deno
This package works with Browsers
JSR Score100%
Published11 months ago (0.1.3)

Serve files embedded within an archive file using msw

@cdaringe/archive-filesystem-service-worker

Given an archive, serve files from that archive using msw.

For example, assume the following tarball:

# foo.tar.gz
.
├── static-storybook
   ├── assets.js
   ├── styles.css
   └── img.png
└── package.json

After installing the service worker in browser,

GET /static-storybook/assets.js would resolve the file from the archive.

usage

import { createTarballFilesHandler } from "jsr:archive-filesystem-service-worker/msw.ts";
import msw from "msw";

const handler = await createTarballFilesHandler(
  msw,
  "https://path.to/tarball.tgz"
);
const worker = setupWorker(handler);
worker.start();
Built and signed on
GitHub Actions

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.