node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

rm-file

rm-file

Remove a file

  • Promise interface.
  • User-friendly errors.

Installation

npm install --save rm-file

Usage

const rmFile = require('rm-file')
 
rmFile('useless-file.txt').then(() => {
  console.log('File removed')
})

API

rmFile(path)

Returns a Promise.

path

Type: string

File you want to remove.

Related

  • cp-file - Copy a single file
  • make-dir - Make a directory and its parents if needed