fs.mkdir-shim
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    fs.mkdir-shim

    Build Status npm

    Polyfill for fs.mkdir in node versions < v10.12

    node v10.12.0 added support for a recursive option for fs.mkdir: https://github.com/nodejs/node/pull/21875

    This package provides the built-in fs.mkdir in node v10.12.0 and later, and a replacement in other environments.

    The replacement uses make-dir module.

    Requirements

    This module requires Node >= 6.

    This package implements the es-shim API interface. It works in an ES6-supported environment and complies with the spec.

    Installation

    npm install fs.mkdir-shim

    Additionally for Typescript:

    npm install -D @types/node

    Usage

    Direct

    const mkdir = require('fs.mkdir-shim');
    // Use `mkdir` just like the built-in method on `fs`

    Typescript:

    import mkdir from 'fs.mkdir-shim';
    // Use `mkdir` just like the built-in method on `fs`

    Shim

    require('fs.mkdir-shim/shim')();
    // `fs.mkdir` is now defined
    const fs = require('fs');
    // Use `fs.mkdir`

    or:

    require('fs.mkdir-shim/auto');
    // `fs.mkdir` is now defined
    const fs = require('fs');
    // Use `fs.mkdir`

    Typescript:

    import mkdirShim from 'fs.mkdir-shim/shim';
    mkdirShim();
    // `fs.mkdir` is now defined
    import fs from 'fs';
    // Use `fs.mkdir`

    or:

    import 'fs.mkdir-shim/auto';
    // `fs.mkdir` is now defined
    import fs from 'fs';
    // Use `fs.mkdir`

    License

    Copyright (c) 2018-2020 Piotr Roszatycki piotr.roszatycki@gmail.com

    MIT

    Install

    npm i fs.mkdir-shim

    DownloadsWeekly Downloads

    31

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    11.8 kB

    Total Files

    14

    Last publish

    Collaborators

    • dex4er