0.1.1 • Published 10 years ago
fs-read-queue v0.1.1
fs-read-queue

Queue
fs.readFilecalls to the same file path.The code in this module is inspired by the work done by mhiguera in this pull request.
Install with npm
$ npm i fs-read-queue --saveUsage
var readFile = require('fs-read-queue');API
readFile
File reading function that will queue up calls to fs.readFile for the same filepath to prevent ENFILE errors.
Params
fp{String}: File path to readoptions{String}: Additional options to pass tofs.readFilecb{Function}: Callback function that takeserrandcontentsparameters. Will be called when the file is read.
Example
readFile('path/to/my/file', function (err, contents) {
if (err) return console.error(err);
console.log(contents);
});Running tests
Install dev dependencies:
$ npm i -d && npm testContributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Brian Woodward
License
Copyright © 2015 Brian Woodward Released under the MIT license.
This file was generated by verb-cli on July 01, 2015.