JSON.parse()

Parse data from a JSON-encoded string.

Usage

Hover over inputs/exits for more info.

var JSON = require('machinepack-json');


// Parse data from a JSON-encoded string.

JSON.parse({

json: '...{"some json": "like this"}...',

schema: '*',

}).execSync();

Inputs

json required

The JSON string to parse

'...{"some json": "like this"}...'
schema

A representative example (RTTC exemplar) of what the resulting data should look like.

'*'

Exits

error

An unexpected error occurred.

couldNotParse

Could not parse provided string- must be a valid JSON string.

success

OK.

(varies based on provided inputs)