tasks/json_bake.js
function parseDirectory( path ) {

            return fs.readdirSync( path )

                .map( function( file ) {

                    var filePath = path + "/" + file;

                    if ( isIncludeFile( filePath ) ) return parseFile( filePath );
                    else if ( isDirectory( filePath ) ) return parseDirectory( filePath );

                    return null;
                } )

                .filter( function( value ) {

                    return value !== null;

                } );
        }
function parseDirectory( path ) {

            return fs.readdirSync( path )

                .map( function( file ) {

                    var filePath = path + "/" + file;

                    if ( isIncludeFile( filePath ) ) return parseFile( filePath );
                    else if ( isDirectory( filePath ) ) return parseDirectory( filePath );

                    return null;
                } )

                .filter( function( value ) {

                    return value !== null;

                } );
        }
function parseDirectory ( path ) { return fs . readdirSync ( path ) . map ( function ( file ) { var filePath = path + "/" + file ; if ( isIncludeFile ( filePath ) ) return parseFile ( filePath ) ; else if ( isDirectory ( filePath ) ) return parseDirectory ( filePath ) ; return null ; } ) . filter ( function ( value ) { return value !== null ; } ) ; }
Parses a directory and returns content as array
Parses a directory and returns content as array