Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

workbox-recipes

Package Overview
Dependencies
Maintainers
6
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workbox-recipes

A service worker helper library to manage common request and caching patterns

  • 6.2.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.3M
decreased by-26.23%
Maintainers
6
Weekly downloads
 
Created

What is workbox-recipes?

The workbox-recipes npm package provides pre-configured, common service worker strategies and behaviors for web applications using Workbox. It simplifies the implementation of caching, offline functionality, and other progressive web app (PWA) features.

What are workbox-recipes's main functionalities?

Offline Page

This feature allows you to specify fallback pages or images when the network is unavailable. The code sample shows how to set up offline fallbacks for both pages and images.

import { offlineFallback } from 'workbox-recipes';

offlineFallback({
  pageFallback: '/offline.html',
  imageFallback: '/static/images/offline.jpg'
});

Static Resource Caching

Enables caching for static resources such as CSS and JavaScript files. The code sample demonstrates pre-caching specific URLs on service worker installation.

import { staticResourceCache } from 'workbox-recipes';

staticResourceCache({
  warmupUrls: ['/styles/main.css', '/scripts/main.js']
});

Google Fonts Caching

Provides a simple method to cache Google Fonts used on your web pages, enhancing performance and reducing data usage.

import { googleFontsCache } from 'workbox-recipes';

googleFontsCache();

Other packages similar to workbox-recipes

Keywords

FAQs

Package last updated on 11 Aug 2021

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