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 posix = require("posix"); | |
| var sys = require("sys"); | |
| var continuables = require('continuables'); | |
| function writeFile(filename, value, mode) { | |
| if (typeof value !== "string") { | |
| throw new Error('Value must be a string'); | |
| } | |
| if (typeof mode === "undefined") { | |
| mode = 0600; |
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
| exports.create = function() { | |
| var queue = [], | |
| queueIndex = 0; | |
| // I don't know if we want to save state, but it is easy to implement. | |
| // I am just worried about overhead | |
| var cachedValue = null; | |
| var enqueue = function enqueue(func) { | |
| queue.push(func); |
NewerOlder