Skip to content

Instantly share code, notes, and snippets.

@chfritz
Created June 16, 2014 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chfritz/5d35e173ea3c7a883718 to your computer and use it in GitHub Desktop.
Save chfritz/5d35e173ea3c7a883718 to your computer and use it in GitHub Desktop.
A tiny bash script that loads a given JSON file into an interactive node.js shell. Once the shell is loaded, look at the variable `json`.
#!/bin/bash
# explore a JSON file in node.js
# run: seejson.sh file.json
# then look at "json" in the opening node shell
node -e "json = require(\"./$1\"); repl = require(\"repl\").start(\"> \"); console.log(\"loaded... see json\");"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment