Home

Awesome

render-appcache-manifest Build Status Dependency Status

Renders HTML5 application cache manifest.

See also parse-appcache-manifest.

Usage

npm install render-appcache-manifest

Generate Manifest from Direct Object

renderManifest = require "render-appcache-manifest"
renderManifest(contents)

renderManifest returns the rendered manifest as a string.
contents is an object that can have the following properties, all optional:

There's no way to control layout of the generated manifest. The output will be generally neat.

render-appcache-manifest will not validate the correctness of input. You are responsible for providing corrent urls or url-patterns, where appropriate. Also, adding a multi-line string as a comment will break the manifest.

Generate Manifest from Tokens

If you need fine grained control over the rendering process, you may pass in a list of ordered tokens to render a manifest. The tokens are generated by https://github.com/meryn/parse-appcache-manifest, but you can just as easily craft your own token list provided the format matches.

appcacheRender = require 'render-appcache-manifest'
out = appcacheRender tokens

Development

To compile the code:

npm install # once, to get the dev dependencies
make build

To test the code:

npm test

Credits

The initial structure of this module was generated by Jumpstart, using the Jumpstart Black Coffee template.

Tokenizing support, settings support, whatwg spec conformance, and updated documentation from https://github.com/mreinstein.

License

render-appcache-manifest is released under the MIT License.
Copyright (c) 2013 Meryn Stol, Michael Reinstein