diff --git a/lib/modules/console/index.js b/lib/modules/console/index.js index 1c21a04b6..2ad53b9f7 100644 --- a/lib/modules/console/index.js +++ b/lib/modules/console/index.js @@ -3,6 +3,7 @@ let utils = require('../../utils/utils'); const EmbarkJS = require('embarkjs'); const IpfsApi = require('ipfs-api'); const Web3 = require('web3'); +const stringify = require('json-stringify-safe'); class Console { constructor(_embark, options) { @@ -31,7 +32,7 @@ class Console { let plugin = this.plugins.createPlugin('consoleApi', {}); plugin.registerAPICall('post', '/embark-api/command', (req, res) => { this.executeCmd(req.body.command, (_err, result) => { - res.send({result}); + res.send({result: stringify(result, null, 2)}); }); }); }