JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 42
  • Score
    100M100P100Q56309F
  • License ISC

Read a file, then remove it

Package Exports

  • read-remove-file

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (read-remove-file) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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