fileDoesntExist

It resolves the supposedFileLocation parameter if the file indeed does not exist. If file exists, it will reject an ExistingFileError.
Parameter ListReturnsRejection Errors
  • supposedFileLocation: string
  • tuple: Array (Optional)
Promise<string || Array>
Related FunctionsFunction Signature
function fileDoesntExist(supposedFileLocation[, tuple]): Promise<string || Array>
1 2 3 4 import {fileDoesntExist} from 'puddy-m/lib/fileFunctions' fileDoesntExist('path/to/supposed/file') .then(supposedfilePath=>console.log(supposedfilePath)) // prints 'path/to/supposed/file'
1 2 3 4 import {fileDoesntExist} from 'puddy-m/lib/fileFunctions' fileDoesntExist(true) .catch(e=>e)
1 2 3 4 5 6 // Using it with tuple parameter import {fileDoesntExist} from 'puddy-m/lib/fileFunctions' fileDoesntExist('path/to/supposed/file', []) .then(tuple=>validateString("World", tuple)) .then(([first, second])=> first + second) // 'path/to/supposed/fileWorld'