jokeyrhyme / appcache.js

parse and manipulate AppCache manifests
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

appcache.js npm module AppVeyor Status Travis CI Status

parse and manipulate AppCache manifests

What is this?

This module exports an AppCache constructor, and a parser function so that your JavaScript code can understand and manipulate the string contents of an AppCache Manifest.

Supported Environments

This is module is not designed to work in web browsers as-is, due to the use of the CommonJS module pattern, and Node.js' crypto built-in.

You should be able to use this in Node.js as-is, or in web browsers with a CommonJS-compatible bundler like WebPack or Browserify.

API

AppCache

AppCache#sha1

Having a hash is useful for comparing AppCache manifests files.

AppCache#cache

AppCache#fallback

AppCache#network

AppCache.parse(contents)

Usage

var AppCache = require('@jokeyrhyme/appcache');

var appCache = AppCache.parse(/* string downloaded from an AppCache URL */);

console.log(appCache.cache);
// [ ... ] Array of URL Strings from all CACHE sections of the AppCache manifest