To use mkdirp
function from fs-extra
library in Typescript, you need to first install the library using npm:
index.ts28 chars2 lines
After that, you need to import the library in your Typescript file:
index.ts32 chars2 lines
Now, you can use the mkdirp
function to create a directory recursively:
index.ts171 chars9 lines
The mkdirp
function takes two parameters: the path of the directory to be created and a callback function. The callback function is called with an error object if there is an error creating the directory. If the directory is created successfully, the callback function is called with no arguments.
gistlibby LogSnag