Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura
lyxaira.glass 74ca844f42 Actualizacion cambios generados: seccion #12, #14 y #15. 4 anos atrás
..
LICENSE Actualizacion cambios generados: seccion #12, #14 y #15. 4 anos atrás
README.md Actualizacion cambios generados: seccion #12, #14 y #15. 4 anos atrás
index.js Actualizacion cambios generados: seccion #12, #14 y #15. 4 anos atrás
package.json Actualizacion cambios generados: seccion #12, #14 y #15. 4 anos atrás

README.md

with-open-file Build Status

Do stuff with an open file, knowing it will finally be closed

Because the built-in way requires way too much boilerplate.

Install

$ npm install with-open-file

Usage

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
})

API

withOpenFile(…openArgs, callback)

Returns a Promise wrapping the result of calling callback with the requested file descriptor.

withOpenFile.sync(…openArgs, callback)

Returns the result of calling callback with the requested file descriptor.

…openArgs

Arguments as supported by fs.openSync

callback

Type: function

License

MIT © Raphael von der Grün