Node module that creates missing folders in the middle of a path, like
Let's say you want to create the file
docs/UI/button.txt, but the folders
docs don't exist.
If you just try to create the file, this happens:
> fsThrown:Error: ENOENT: no such file or directory open 'docs/UI/button.txt'at Objectat Objecterrno: -2syscall: 'open'code: 'ENOENT'path: 'docs/UI/button.txt'
If you try to create the folder you get this:
> fsThrown:Error: ENOENT: no such file or directory mkdir 'docs/UI'at Object errno: -2 syscall: 'mkdir' code: 'ENOENT' path: 'docs/UI'
Using this library you can create the inner folders easily:
const openPath = ;;
npm install rfc-open-path
const openPath = ;
pathToOpen: String with the path.
fileInPath: Indicates if the last item of the path is a file.
callback: Called after the directories were created or after an error.
promise: Resolves to nothing after the directories are created or rejects with an error.
Full tests with coverage
Unit tests and watch for changes
npm run unit-test