json-directory
v1.0.1
Published
This library is used to create directories by muliple nested JSON.
Readme
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", …]
