fs-force-mkdir

1.4.0 • Public • Published

fs-force-mkdir

Requirements

  • Node >= 6.0.0

Usage

var mkdir = require('fs-force-mkdir');
mkdir('./a/b/c', (error, info) => {
    if (error) {
        console.error('Failed', error);
    } else {
        console.log('Succeed', info);
    }
});

The code above would check for existence of './a', './a/b' and './a/b/c',

  • If one is a directory, mkdir skip this directory and check the next
  • If one doesn't exist, mkdir would creates it as a empty directory
  • If one is a file, mkdir would deletes that file and creates a directory with the same name

License

MIT © Hoàng Văn Khải

Package Sidebar

Install

npm i fs-force-mkdir

Weekly Downloads

2

Version

1.4.0

License

MIT

Last publish

Collaborators

  • khai96_