JSON: JSON, encoding/json, serde_json, nlohmann/json
#JSON is a built-in global with two functions: JSON.parse turns text into plain values and JSON.stringify turns values into text, with optional indentation. Parsing does not check the result against a TypeScript type; the type is an assumption you make, so validate untrusted input by hand or with a schema library such as Zod. Dates become strings and undefined fields are dropped.
Complete program
Complete program. Built in: globals need no import; node: modules ship with Node.
Most used: JSON.parse, JSON.stringify(value, null, 2), response.json() with fetch, a reviver or replacer for custom types.
Zod (4.x, npm install zod) is the common schema library: const User = z.object({ name: z.string(), age: z.number().int() }) describes the shape once, User.parse(JSON.parse(text)) checks it and throws a ZodError with every problem, safeParse returns a result instead of throwing, and type User = z.infer<typeof User> derives the TypeScript type so the two cannot drift.
Valibot and ArkType fill the same role. Validate at the boundary where untrusted text enters (a request body, a file, an environment variable) and pass typed values inward.