path existed or create For Nodejs only install yarn add path-existed-or-create const pathExistedOrCreate = require("path-existed-or-create"); dirPath = "tempDir"; pathExistedOrCreate(dirPath);