Skip to content
Node: JSON.parse/stringify7 APIs

json

Package json provides JSON parse/stringify helpers. Node equivalent: JSON.parse, JSON.stringify

import "github.com/sahilkhaire/gox/json"
## API reference

Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.

Functions

SymbolNode.jsKindSummary
MustParsefuncMustParse unmarshals or panics.
MustStringifyfuncMustStringify marshals or panics.
ParseJSON.parse(str)funcParse unmarshals data into v (JSON.parse).
ParseFilefuncParseFile reads path and unmarshals into v.
PrettyfuncPretty returns indented JSON.
StringifyJSON.stringify(obj)funcStringify marshals v to a string (JSON.stringify).
WriteFilefuncWriteFile marshals v and writes to path (helper for examples).

MIT Licensed · Built for Node.js developers moving to Go