Skip to content

bshankar/jdad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JDAD

An extremely tiny JSON parser written in Js to learn how recursive descent parsing works. The parser’s design is inspired by Monads and is just 34 SLOC!

Usage

# Parsing a file
node src/index.js test/twitter.json

# Benchmark against JSON.parse
node src/index.js test/twitter.json bench

Limitations

  • Extremely slow! 50-100 times slower than JSON.parse.
  • Does not show where a syntax error occurred. It just returns null when an invalid JSON is encountered.
  • Does not unescape escape sequences. It does now!

About

An extremely tiny Json parser in Javascript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published