lyxaira.glass 74ca844f42 Actualizacion cambios generados: seccion #12, #14 y #15. | 4 년 전 | |
---|---|---|
.. | ||
LICENSE | 4 년 전 | |
README.md | 4 년 전 | |
index.js | 4 년 전 | |
package.json | 4 년 전 |
Do stuff with an open file, knowing it will finally be closed
Because the built-in way requires way too much boilerplate.
$ npm install with-open-file
const withOpenFile = require('with-open-file')
withOpenFile('foo.txt', 'r', fd => {
// Process file using fd
})
withOpenFile.sync('foo.txt', 'r', fd => {
// Process file synchronously using fd
})
Returns a Promise
wrapping the result of calling callback
with the requested file descriptor.
Returns the result of calling callback
with the requested file descriptor.
Arguments as supported by fs.openSync
Type: function
MIT © Raphael von der Grün