Converting script to JSON reader