Skip to content

@vtjDocs


@vtj / node / removeSync

Function: removeSync()

removeSync(dir): void

Removes a file or directory. The directory can have contents. If the path does not exist, silently does nothing.

Parameters

dir: string

Returns

void

Example

ts
import * as fs from 'fs-extra'

// remove file
fs.removeSync('/tmp/myfile')

fs.removeSync('/home/jprichardson') // I just deleted my entire HOME directory.

Defined in

packages/node/src/fs.ts:27

Released under the MIT License.