New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@archetypical/scaffold

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@archetypical/scaffold

Service worker library modeled after the .NET core middleware pipeline

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Scaffold

Scaffold

Scaffold is an library designed to quickly build service workers modeled after the .NET core middleware pipeline.

Example implementation

// service-worker.ts

import { IApplicationBuilder, Scaffold } from "@archetypical/scaffold";
import { strategies } from "swork-cache";

const offlineAssets = ["/css/site.css", "/js/site.js", "/"];

class Startup {
    public configure(builder: IApplicationBuilder): void {
        builder
            .useInstallCache(offlineAssets)
            .map(offlineAssets, strategies.backgroundFetch());
    }
}

Scaffold
    .createBuilder("1.0.0")
    .useStartup(Startup)
    .build();

In the example above, we were able to quickly define a list of assets that should be cached up on install of the service worker. In addition, each new request for those assets will immediately return the cached response and update the cache with the latest version in a background process.

  • Overview
  • IApplicationBuilder
  • IServiceCollection
  • IServiceProvider
  • IServiceWorkerBuilder
  • IApplicationLifetime
  • Startup

Keywords

FAQs

Package last updated on 02 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc