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
MustParse—funcMustParse unmarshals or panics.
MustStringify—funcMustStringify marshals or panics.
ParseJSON.parse(str)funcParse unmarshals data into v (JSON.parse).
ParseFile—funcParseFile reads path and unmarshals into v.
Pretty—funcPretty returns indented JSON.
StringifyJSON.stringify(obj)funcStringify marshals v to a string (JSON.stringify).
WriteFile—funcWriteFile marshals v and writes to path (helper for examples).

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