# appcachegen

> Generate AppCache from local directory

Latest version **0.0.3** (published 2014-11-30) · Apache v2 license · 0 weekly downloads

## Install

```sh
npm install appcachegen
pnpm add appcachegen
yarn add appcachegen
bun add appcachegen
```

Provides the command `appcachegen`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2014-11-30 |
| First published | 2014-11-30 |
| Weekly downloads | 0 |
| License | Apache v2 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Dale Harvey |
| Maintainers | daleharvey |
| Keywords | appcache, html5, generator, offline, webapp |

## Links

- npm: https://www.npmjs.com/package/appcachegen
- Repository: https://github.com/daleharvey/appcachegen
- Issues: https://github.com/daleharvey/appcachegen/issues
- npm.io page: https://npm.io/package/appcachegen

## Dependencies (3)

- [yargs](https://npm.io/package/yargs.md) ^1.3.3
- [ignore](https://npm.io/package/ignore.md) ^2.2.15
- [node-dir](https://npm.io/package/node-dir.md) ^0.1.6

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2014-11-30
- 0.0.2 — 2014-11-30
- 0.0.1 — 2014-11-30
- 0.0.0 — 2014-11-30

## README

appcachegen
===========

A node module that generates a HTML5 AppCache manifest for static
websites based on a directories contents.

Install
-------

    $ npm install appcachegen --save

to install in your project or

    $ npm install -g appcachegen

to install globally

Usage
-----

appcachegen can be used at the command line or in your node.js code,

    $ appcachegen --help
    Usage: appcachegen [directory] [options]

     Options:
      -o, --output  Write to file
      -i, --ignore  Ignore file
      -r, --rules   Extra rules file
      --help, -h    Show help

Example use

    $ appcachegen _site/ > _site/manifest.appcache
    $ cat _site/manifest.appcache
    $ node appcachegen.js ~/src/pouchdb/docs/_site/
    CACHE MANIFEST
    # Sun Nov 30 2014 10:45:02 GMT+0100 (CET)

    /adapters.html
    /api.html
    /errors.html
    /external.html
    /static/favicon.ico
    /static/css/pouchdb.css
    /static/img/apple-indexeddb.png

    NETWORK:
    *

Ignoring Files
--------------

By default appcachegen will look for `.appcacheignore` and ignore any files
which match the rules listed in that file, you can specify a path to the
ignore file with `-o`

    $ appcachegen -o ~/project/.gitignore

Including Rules
---------------

You will often need to add external files and customise how `NETWORK` and
`FALLBACK` are handled, you can do this by pointing to an extra file to include
in the manifest

    $ cat manifest-rules
    http://code.jquery.com/jquery.min.js
    http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js

    $ appcachegen -r manifest-rules
    CACHE MANIFEST
    # Sun Nov 30 2014 10:45:02 GMT+0100 (CET)

    /index.html
    /static/img/apple-indexeddb.png

    http://code.jquery.com/jquery.min.js
    http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js

    NETWORK:
    *

Configuring NETWORK / FALLBACK
------------------------------

By default `appcachegen` will provide a sensible default for the `NETWORK:`
field:

    NETWORK:
    *

If you want to customise this then you can add them to the included rules
file as above `$ appcachegen -r manifest-rules`, if you specify your own
`NETWORK` option the default will not be provided.

Automatic index.html
--------------------

Web servers will usually allow you to access `/path/index.html` as `/path/`
if you dont specify both in the AppCache then the link will be broken when
offline, `appcachegen` will automatically add both to the AppCache.

Issues
------

If you have any issues using `appcachegen` or features you require, then please
file a bug @ https://github.com/daleharvey/appcachegen/issues.

---
_Source: https://npm.io/package/appcachegen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
