The JSON object provides the C++ versions of the methods offered by the JSON
object in javascript. V8 exposes these methods via the v8::JSON
object.
Refer to the V8 JSON object in the V8 documentation for more information about these methods and their arguments.
A simple wrapper around v8::JSON::Parse
.
Definition:
c++
Nan::MaybeLocal<v8::Value> Nan::JSON::Parse(v8::Local<v8::String> json_string);
Use JSON.Parse(json_string)
to parse a string into a v8::Value
.
Example:
```c++
v8::Local
Nan::JSON NanJSON;
Nan::MaybeLocal
A simple wrapper around v8::JSON::Stringify
.
Definition:
c++
Nan::MaybeLocal<v8::String> Nan::JSON::Stringify(v8::Local<v8::Object> json_object, v8::Local<v8::String> gap = v8::Local<v8::String>());
Use JSON.Stringify(value)
to stringify a v8::Object
.
Example:
``c++
// using
v8::Localfrom the
JSON::Parse` example
v8::Local
Nan::JSON NanJSON;
Nan::MaybeLocal