5.0.1 • Published 6 years ago

read-remove-file v5.0.1

Weekly downloads
19
License
ISC
Repository
github
Last release
6 years ago

read-remove-file

NPM version Build Status Build status Coverage Status

Read a file, then remove it

const readRemoveFile = require('read-remove-file');

readRemoveFile('path/to/file').then(buf => {
  buf; //=> <Buffer ... >
  fs.accessSync('path/to/file'); // Error: ENOENT
});

Installation

Use npm.

npm install read-remove-file

API

const readRemoveFile = require('read-remove-file');

readRemoveFile(filePath , options)

filePath: String
options: Object or String (fs.readFile options)
Return: Promise

It reads a file, removes the file and returns a promise of the file contents.

readRemoveFile('path/to/file', 'utf8').then(str => {
  str; //=> 'file contents'
  fs.accessSync('path/to/file'); // Error: ENOENT
});

License

ISC License © 2018 Shinnosuke Watanabe

5.0.1

6 years ago

5.0.0

7 years ago

5.0.0-1

7 years ago

4.0.0

8 years ago

3.0.0

9 years ago

2.0.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago