Created
August 25, 2015 16:14
-
-
Save oimou/05e6e12a0c142173b0b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| }); | |
| } | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment