npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

graph-object-notation

v0.1.6

Published

Graph parser/serializer superset of JSON

Readme

Graph Object Notation

ALPHA STATE WARNING, PLEASE DO NOT USE IN PRODUCTION, STUFF BREAKS ALL THE TIME

The goal of this package is to provide a way to serialize/parse graph objects with a syntax as close as possible to JSON. The serialized data format is a superset of the JSON data format and holds the extension .gon

How to install

npm install graph-object-notation --save

How to use

import GON from 'graph-object-notation'

const graph = GON.parse(`{
  "foo":{"name":"bar"},
  "ref":@foo@
}`)

console.log(JSON.stringify(graph))
// Returns {"foo":{"name":"bar"},"ref":{"name":"bar"}}

console.log(GON.stringify(graph))
// Returns {"data":{"foo":@references.0xf001@,"ref":@references.0xf001@},"references":{"0xf001":{"name":"bar"}}}

Accepted serialization

GON is a superset of JSON, everything JSON should work using GON.parse In addition to JSON, GON offers a few more serialization options:

{
  "date":|2019-12-17T12:00:00.000Z|,
  "bigInt":42n,
  "Symbol":±debug±,
  "Reference":@bigInt@
}

Import options

You can import the whole suite with import GON from 'graph-object-notation or just the part you need with import {parse,stringify} from 'graph-object-notation'

GON.parse(stringToBeParsed)

Parse stringToBeParsed in the GON format, resolve references and provide a JS object that can be a graph

GON.stringify(objectToSerialize, replacer, spaces, target)

/!\ Stringify mutate the objectToSerialize , this is a know bug and will be resolved later on

/!\ Stringify return a serialized version of your string on the form {"data":{...yourObject/array}, target:{...}}, if you want to stringify and parse in succession, you'll need to GON.parse(GON.stringify({test:"hello"}).data to get the expected result

Serialize objectToSerialize to the GON format. default is {}

replacer is not yet implemented and will work like the replacer from JSON.stringify. default is null

space is used to make the serialized string more readable for human, works like space from JSON.stringify, default is 0

target specify the property that will hold the references, default is "references"

RoadMap

The goal is to provide a serialization for useful JS types of object/primitive, and graph supports. Next versions will focus on :

  • Making stringify immutable
  • Adding tests for automatic deployements
  • Improved resiliency of the parse/stringify functions
  • Better optimization of the parse/stringify functions
  • Adding support for Maps and Sets
  • Adding support for single-quote/backquote notation for strings
  • Adding Conditionnal checks on toGON(), and toJSON() for unknown objects.
  • Adding logic for the replacer