npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

appcache-manifest

v2.1.0

Published

A CLI tool to generate HTML5 Application Cache Manifest.

Downloads

512

Readme

appcache-manifest

npm version Downloads/month Build Status Coverage Status Dependency Status

A CLI tool to generate HTML5 Application Cache Manifest.

  • appcache-manifest command generates the manifest file of given files.
    • The manifest file includes the md5 hash which is calculated from the content of the files.
    • You can regenerate the manifest file when the files are changed by --watch option.

:cd: Installation

$ npm install appcache-manifest
  • Requires Node.js 4 or later.

:book: Usage

This provides 2 commands; appcache-manifest and appcache-manifest-fixer.

  • appcache-manifest is the command to generate manifest files.
  • appcache-manifest-fixer is the command to add manifest attribute into a HTML file.
Usage: appcache-manifest [OPTIONS] [FILES...]

    FILES: File globs that includes into manifest.

Options:
    -o, --output <FILE_PATH>    The path of an output file.
                                Prints to stdout by default.
    -p, --prefix <PATH>         The prefix part of each path in cache section.
    -P, --postfile <FILE_PATH>  The path of a postfix file.  The file will be
                                concatinated after generated contents.
    -h, --help                  Prints this text.
    -v, --verbose               Prints detail messages in progress. This option
                                must be used together with '--output' option.
    -V, --version               Prints version number.
    -w, --watch                 This command would be watching target files and
                                directories if --watch option is specified.
                                Then it regenerates the manifest file when those
                                files are added, removed, or changed.
    --network-star              Adds "NETWORK:\n*" after generated contents.
    --stamp                     Stamps the output with the date/time instead
                                of an md5 hash.
Usage: appcache-manifest-fixer [FILE_PATH] [OPTIONS]

    This command would add "manifest" attribute into <html> tag.

    FILE_PATH: The target HTML file path.
               Reading from stdin by default

Options:
    -o, --output <FILE_PATH>  The path of an output file.
                              Writing to stdout by default.
    -h, --help                Prints this text.
    -m, --manifest <PATH>     The path of a manifest file. The path will be set
                              to the value of "manifest" attribute.
                              "index.appcache" by default.
    -v, --version             Prints version number.

Examples

appcache-manifest "app/index.{html,css,js}" "app/lib/**/*.{css,js}" --network-star -o app/index.appcache
appcache-manifest "app/**/*.{html,css,js}" --postfile src/api.txt --postfile src/fallback.txt -o app/index.appcache

:turtle: Node.js API

var am = require("appcache-manifest");

am.generate(fileGlobs, options)

Generate a manifest file content; path list and a md5 hash comment.

  • fileGlobs string|string[] -- Globs that includes into CACHE section of the manifest.
  • options object
    • options.prefix string -- The prefix part of each path in cache section.
    • options.postfile string|string[] -- Paths of a postfix file. The file will be concatinated after generated contents.
    • options.networkStar boolean -- A flag to add "NETWORK:\n*" after generated contents.
    • options.stamp boolean -- Stamps the output with the date/time instead of an md5 hash.

This function returns stream.Readable. The stream outputs generated contents.

am.createFixer(options)

Add a "manifest" attribute into <html> tag.

  • options object
    • options.manifest string -- A path to a manifest file. By default, "index.appcache".

This function returns stream.Transform. The stream detect <html> tag from inputs, and add a manifest attribute.

:newspaper: Changelog

:muscle: Contributing

Welcome contributing!

Please use GitHub's Issues/PRs.

Development Tools

  • npm test runs tests and measures coverage.
  • npm run coverage shows the coverage result of npm test command with the default browser.
  • npm run clean removes the coverage result of npm test command.
  • npm run lint runs ESLint.
  • npm run watch runs tests with --watch option.