
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
In 2008, I invented a shittier version of JSON. This module is a functional version of the original implementation I created. I've tried to faithfully recreate the syntax, bugs and oddities of the format I invented back then before, apparently, I knew how to Google things.
npm install --save ogson
Convert a JavaScript object to OGSON:
'use strict';
const og = require('ogson');
let ogString = og.serialize({
foo: 'bar'
});
console.log(ogString);
Turn a OGSON string into an object:
'use strict';
const og = require('ogson');
let ogString = '###@@@foo!!!@@@bar!!!^^^';
let ogObject = og.makeObject(ogString);
console.log(ogObject);
Much like the better, more feature-rich JSON, I invented the OGSON format (which didn't have a name then) to provide a data transport format that more closely modeled the objects I was working with than XML. Here's what it could do.
At the core of OGSON were values, begun by @@@
character sequences and ended
by !!!
sequences. Values were used as members of arrays and keys/values for
hashes (see below).
@@@some value!!!
OGSON would try to guess the type of value inside the @@@
and !!!
characters:
Array
or Object
(see below)Boolean
if it's the text "true" or "false" (case insensitive)Number
String
if all else failsOh, you better believe we got those. Opened and closed by a [[[
and ]]]
sequence respectively, values could be added in between them.
[[[
@@@foo!!!
@@@bar!!!
@@@baz!!!
]]]
Yup, we got 'em! Denoted by a start character set of ###
and an end set of ^^^
,
you could create a key/value object. Properties and values were denoted with
@@@
/ !!!
patterns as you might expect.
###
@@@foo!!! @@@bar!!!
^^^
All these different types could be combined (usually) to model complex objects.
###
@@@name!!! @@@ogson!!!
@@@version!!! @@@1.0.0!!!
@@@scripts!!! @@@###
@@@test!!! @@@node test.js!!!
^^^!!!
@@@keywords!!! @@@[[[
@@@object!!!
@@@notation!!!
@@@wheel!!!
@@@reinventing!!!
]]]!!!
^^^
Put that in your pipe and smoke it, Crockford! Thanks to the half-assed parsing logic of OGSON, Comments are supported as free text just about anywhere... so long as they don't use the magic character sequences incorrectly.
In fact, so long as you don't run afoul of the magic character sequences, you can get pretty creative with your formatting.
This is a package.json converted to OGSON
###
Here's the name of the package
@@@name!!! => @@@ogson!!!
We specify the version here
@@@version!!! -> @@@1.0.0!!!
These are npm run scripts - you can run the tests with "npm test"
@@@scripts!!! ¯\_(ツ)_/¯ @@@###
@@@test!!! @@@node test.js!!!
^^^!!!
Keywords, yo!
@@@keywords!!! @@@[[[
* @@@object!!! Objects!
* @@@notation!!! Notation!
* @@@wheel!!! Wheels!
* @@@reinventing!!! Reinventing!
]]]!!!
^^^
You don't want to represent EVERY kind of data, do you? Here are some things the original (and this iteration of) OGSON can't do:
Number
as a String
MIT - as if you would want this code for any reason.
FAQs
The Original Gangster's Object Notation
The npm package ogson receives a total of 0 weekly downloads. As such, ogson popularity was classified as not popular.
We found that ogson demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.