json-directory

1.0.1 • Public • Published

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", …]

Readme

Keywords

Package Sidebar

Install

npm i json-directory

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

2.95 kB

Total Files

3

Last publish

Collaborators

  • rohitparte