1.0.0 • Published 7 years ago

enfsmkdirp v1.0.0

Weekly downloads
12
License
CC-BY-4.0
Repository
github
Last release
7 years ago

Build Status Build status Codacy Badge Donate

NPM

enfsmkdirp

Module that add list functionality to node fs module

enfs stands for Easy Node 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

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

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.