0.2.0 • Published 9 years ago

virtual-patch v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

virtual-patch

virtual-patch is Node library which allows you to patch files on any system by providing abstract CRUD APIs. This is designed especially for Amazon S3.

How to install

$ npm install virtual-patch

How to use

var patcher = require("virtual-patch");
var diff = "diff string here";

patcher.patch(
    // pass diff string of git style
    diff,

    // read a file of given filename
    function readFile(filename, cb) {
        someAsyncRead(filename, function (err, data) {
            cb(err, data);
        });
    },

    // write content to a file of given filename
    function writeFile(filename, content, cb) {
        someAsyncWrite(filename, content, function (err) {
            cb(err);
        });
    },

    // remove a file of given filename
    function unlink(filename, cb) {
        someAsyncUnlink(filename, function (err) {
            cb(err);
        });
    }
);

Examples

See examples.

License

MIT

0.2.0

9 years ago

0.1.0

9 years ago