As the name say - "exportJson" will download a json file. It takes a select query and result from the query is saved as a json file.

connection.exportJson({
    from: "Table_Name",
    where: {
        Column1: some_value,
        Column2: some_another_value
    }
}).then(function() {
    console.log('Successfully exported');
}).catch(function(error) {
    console.log(error);
});

Example