Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

jayeff

jpsierens13MIT1.0.2

Generates a file tree from json

node

readme

jayeff

Convert json to a file tree

Install

$ npm i jayeff

Usage

// Our converter
const jayeff = require('jayeff');
// The json we want to convert
const fileStructure = require('./tree.json');
// Where we want the dir tree to go
const rootDirectory = './';

// just call the func, pass in the stuff.
// rootDirectory is optional, defaults to the current dir.
jayeff(fileStructure, rootDirectory);

console.log('Done');

json should be like this:

{
    "app": {
        "index.js": "hola"
    }
}

If it's an object, a directory is created. If it's a string, a file is created with the string as content.