index.js
function(json, next) {
                fs.writeFile(out + "/" + path.basename(url).replace('.xml', '.json'), JSON.stringify(json), function (err) {
                    if (err) {
                        return next(err);
                    }
                    next(null, json);
                });
            }
function(json, next) {
                fs.writeFile(out + "/" + path.basename(url).replace('.xml', '.json'), JSON.stringify(json), function (err) {
                    if (err) {
                        return next(err);
                    }
                    next(null, json);
                });
            }
function ( json , next ) { fs . writeFile ( out + "/" + path . basename ( url ) . replace ( '.xml' , '.json' ) , JSON . stringify ( json ) , function ( err ) { if ( err ) { return next ( err ) ; } next ( null , json ) ; } ) ; }
4 - Save the JSON file locally
4 - Save the JSON file locally