char/fjson
friendly JSON implementation in TypeScript
git clone https://git.t4t.associates/char/fjson
17b13b5
main
languages
- TypeScript 98.8%
- Markdown 1.0%
- JSON 0.1%
fjson
config format: "friendly JSON" for TypeScript :D
it is essentially JSON, except:
- the root of a document may be an "implicit map" (i.e. imaginary
{ <doc> }) - simple ASCII identifier keys may be unquoted in maps (e.g.
{ hello: "world" }) - trailing commas are permitted in maps and arrays
- commas can be replaced by newlines in maps and arrays
- strings may be single-quoted
- documents may contain
// comments
import * as fJSON from "@char/fjson" ; const value = fJSON . parse ( "name: 'demo'\nactive: true" ); // => { name: "demo", active: true } fJSON . stringify ({ name :"demo" , targets :[ "linux" , "macos" ] }); // => 'name: "demo"\ntargets: ["linux", "macos"]'