1.1.0 • Published 3 years ago
dir-output v1.1.0
dir-output
An interface for managing a dir.
- dir-output
- ~DirOutput
- new DirOutput(outputPath)
- .remove(file) ⇒ Promise
- .createDir(name, empty) ⇒ Promise
- .empty() ⇒ Promise
- ~DirOutput
dir-output~DirOutput
DirOutput class
Kind: inner class of dir-output
- ~DirOutput
- new DirOutput(outputPath)
- .remove(file) ⇒ Promise
- .createDir(name, empty) ⇒ Promise
- .empty() ⇒ Promise
new DirOutput(outputPath)
Param | Description |
---|---|
outputPath | The path to the dir. |
dirOutput.remove(file) ⇒ Promise
Remove a file or recursively remove a dir. Returns true if file was deleted, and false if file did not exist.
Kind: instance method of DirOutput
Fulfil: boolean
Param | Type | Description |
---|---|---|
file | string | The name of the dir. |
dirOutput.createDir(name, empty) ⇒ Promise
Creates a dir. If this dir was scheduled to be deleted by a empty
operation, this dir is not deleted. Returns a DirOutput with the outputPath being the path of the dir that was created.
Kind: instance method of DirOutput
Fulfil: DirOutput
Param | Type | Default | Description |
---|---|---|---|
name | string | The name of the dir. | |
empty | boolean | true | Whether or not to empty the dir if it was preserved instead of deleted. |
dirOutput.empty() ⇒ Promise
Remove all files and dirs in the output dir.
Kind: instance method of DirOutput
Fulfil: void