1.0.1 • Published 6 years ago

json-directory v1.0.1

Weekly downloads
2
License
ISC
Repository
-
Last release
6 years ago

JSON to create nested directories

This API is build to create recursive nested directories from JSON object

Getting Started

Simply install package with

  npm i json-directory
 
 const jsonDirectory = require("json-directory")

 const obj = {
  "a": {
    "b": {
      "c": {
        
      }
    }
  },
  "d": {
    "e": {
      
    }
  },
  "f": {
    "g": {
      
    }
  }
}

 jsonDirectory.mkdir('./', 'nestedJsonDir', obj, (error, success) => {
    if (error.length > 0) {
        console.log(error)
    } else if (success.length > 0) {
        console.log(success)
    } else {
        console.log('-------------failed---------------')
    }
})

"nestedJsonDir/a", "nestedJsonDir/d", "nestedJsonDir/f", "nestedJsonDir/a/b", "nestedJsonDir/d/e", …

1.0.1

6 years ago

1.0.0

6 years ago