diff options
author | elioat <hi@eli.li> | 2023-06-19 12:27:59 -0400 |
---|---|---|
committer | elioat <hi@eli.li> | 2023-06-19 12:27:59 -0400 |
commit | 1cbdbcff09387f1185e40fa48fd3801e54e5ba86 (patch) | |
tree | d8ab8872a81c0656c62334fb43f4bc07db8aa807 /js/blotbotboot/node_modules/nan/doc/json.md | |
parent | 00761c368216e401eb5b17a677ae51db643d818b (diff) | |
download | tour-1cbdbcff09387f1185e40fa48fd3801e54e5ba86.tar.gz |
Removed node_modules folder because I am an idiot
Diffstat (limited to 'js/blotbotboot/node_modules/nan/doc/json.md')
-rw-r--r-- | js/blotbotboot/node_modules/nan/doc/json.md | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/js/blotbotboot/node_modules/nan/doc/json.md b/js/blotbotboot/node_modules/nan/doc/json.md deleted file mode 100644 index 55beb26..0000000 --- a/js/blotbotboot/node_modules/nan/doc/json.md +++ /dev/null @@ -1,62 +0,0 @@ -## JSON - -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. - - - <a href="#api_nan_json_parse"><b><code>Nan::JSON.Parse</code></b></a> - - <a href="#api_nan_json_stringify"><b><code>Nan::JSON.Stringify</code></b></a> - -Refer to the V8 JSON object in the [V8 documentation](https://v8docs.nodesource.com/node-8.16/da/d6f/classv8_1_1_j_s_o_n.html) for more information about these methods and their arguments. - -<a name="api_nan_json_parse"></a> - -### Nan::JSON.Parse - -A simple wrapper around [`v8::JSON::Parse`](https://v8docs.nodesource.com/node-8.16/da/d6f/classv8_1_1_j_s_o_n.html#a936310d2540fb630ed37d3ee3ffe4504). - -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<v8::String> json_string = Nan::New("{ \"JSON\": \"object\" }").ToLocalChecked(); - -Nan::JSON NanJSON; -Nan::MaybeLocal<v8::Value> result = NanJSON.Parse(json_string); -if (!result.IsEmpty()) { - v8::Local<v8::Value> val = result.ToLocalChecked(); -} -``` - -<a name="api_nan_json_stringify"></a> - -### Nan::JSON.Stringify - -A simple wrapper around [`v8::JSON::Stringify`](https://v8docs.nodesource.com/node-8.16/da/d6f/classv8_1_1_j_s_o_n.html#a44b255c3531489ce43f6110209138860). - -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::Local<v8::Value> val` from the `JSON::Parse` example -v8::Local<v8::Object> obj = Nan::To<v8::Object>(val).ToLocalChecked(); - -Nan::JSON NanJSON; -Nan::MaybeLocal<v8::String> result = NanJSON.Stringify(obj); -if (!result.IsEmpty()) { - v8::Local<v8::String> stringified = result.ToLocalChecked(); -} -``` - |