Firebase.stringToJson()

Firebase writes data as a JSON object. You can convert your JSON-format string to a JSON object with this machine.

This will parse your data from a JSON Object into a string.

Usage

Hover over inputs/exits for more info.

var Firebase = require('machinepack-firebase');


// Firebase writes data as a JSON object. You can convert your JSON-format string to a JSON object with this machine.

Firebase.stringToJson({

string: '{ "User 1": {"email": "user@gmail.com", "password": "password123"}}',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// The data provided is not in valid JSON format.

parseFailure: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

string required

The string you wish to convert.

'{ "User 1": {"email": "user@gmail.com", "password": "password123"}}'

Exits

error

An unexpected error occurred.

parseFailure

The data provided is not in valid JSON format.

success

OK.