This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

enfsmkdirp

1.0.0 • Public • Published

Build Status Build status Codacy Badge Donate

NPM

enfsmkdirp

Module that add list functionality to node fs module

enfs stands for [E]asy [N]ode [fs]

This module is intended to work as a sub-module of enfs

Description

This module will add a method that allows the creation o directories and sub-directories with one command line. Add mkdir -p functionality to node fs module

  • This module will add following methods to node fs module:
    • mkdirp
    • mkdirpSync

Usage

enfsmkdirp

    var enfsmkdirp = require("enfsmkdirp");

Errors

All the methods follows the node culture.

  • Async: Every async method returns an Error in the first callback parameter
  • Sync: Every sync method throws an Error.

Additional Methods

mkdirp

  • mkdirp(path, [options], callback)

Asynchronously create multiple directories levels

path The path can be on the form of a string, an array or "brace-string"

[options]:

  • fs (Object): an alternative fs module to use (default will be enfspatch)
  • mode (String or Number): the mode that will be attributed to the directory being created
  • Path (String)
    enfsmkdirp.mkdirp("/home/path/to/folder", function(err){
        //do something
    });
  • Path (Array)
    enfsmkdirp.mkdirp(["/home/path/to/folder","/var/home/test"], function(err){
        //do something
    });
  • Path ("brace-string")
    enfsmkdirp.mkdirp("./project/{development,production}/{public,css,private,test}", function(err){
        //do something
    });

mkdirpSync

  • mkdirpSync(path, [options])

Synchronously create multiple directories levels

path The path can be on the form of a string, an array or "brace-string"

[options]:

  • fs (Object): an alternative fs module to use (default will be enfspatch)
  • mode (String or Number): the mode that will be attributed to the directory being created
  • Path (String)
    enfsmkdirp.mkdirpSync("/home/path/to/folder");
  • Path (Array)
    enfsmkdirp.mkdirpSync(["/home/path/to/folder","/var/home/test"]);
  • Path ("brace-string")
    enfsmkdirp.mkdirpSync("./project/{development,production}/{public,css,private,test}");

License

Creative Commons Attribution 4.0 International License

Copyright (c) 2016 Joao Parreira joaofrparreira@gmail.com GitHub

This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit CC-BY-4.0.

Package Sidebar

Install

npm i enfsmkdirp

Weekly Downloads

8

Version

1.0.0

License

CC-BY-4.0

Last publish

Collaborators

  • n3okill