Skip to content

Option { recursive: true } has the opposite effect in mkdirSync #7

@michielbdejong

Description

@michielbdejong

Reproduce:

const fs = require('fs');
const fx = require('mkdir-recursive');

const path = 'foo/bar/1';
console.log(fs.existsSync(path));
// fx.mkdirSync(path);
fx.mkdirSync(path, { recursive: true });
console.log(fs.existsSync('foo/'));
console.log(fs.existsSync(path));

Expected:

false
true
true

Actual:

false
true
false

Work-around:
Leave out the { recursive: true } option.

Note that this only affects mkdirSync, not mkdir.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions