New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

manifesto

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

manifesto

Automatically updates cache.manifest version number

0.0.4
latest
Source
npm
Version published
Maintainers
1
Created
Source

manifesto, a node.js module

Automatically updates cache.manifest version number upon files modification. Supports multiply manifest files.

Example

When you call it first time it check mtime for each of listed files in your manifest file, and starts to watch them. After that it serve your manifest file from memory, and adjusts version number to the lastest mtime among listed files.

You can find browser-ready example in test.js

var http = require('http')
  , manifesto  = require('manifesto');

http.createServer(function (req, res) {

  if (req.url == '/manifest.appcache')
  {
    manifesto.fetch('./test-manifest.appcache', '.', function(err, data) {
      if (err) {
        res.writeHead(404, {'Content-Type': 'text/plain'});
        res.end('Something went wrong\n');
        return;
      }

      res.writeHead(200, {'Content-Type': 'text/cache-manifest'});
      res.end(data);
    });
  }
  else
  {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Hello world!\n');
  }
}).listen(1337, "127.0.0.1");

If you make request to manifest.appcache:

$ curl http://localhost:1337/manifest.appcache

The output will be:

CACHE MANIFEST
#v1326771360000

CACHE:
...

Installation

You should have npm installed already.

npm install manifesto

TODO

  • Add watcher for manifest file itself

More Documentation

TBW

Tests

TBW

Credits

Author: Alex Indigo

License

MIT

FAQs

Package last updated on 17 Jan 2012

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