• Stars
    star
    1,923
  • Rank 24,111 (Top 0.5 %)
  • Language
    JavaScript
  • Created over 14 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A JSON parser and validator with a CLI.

JSON Lint

A pure JavaScript version of the service provided at jsonlint.com.

Command line interface

Install jsonlint with npm to use the command line interface:

npm install jsonlint -g

Validate a file like so:

jsonlint myfile.json

or pipe input into stdin:

cat myfile.json | jsonlint

jsonlint will either report a syntax error with details or pretty print the source if it is valid.

Options

$ jsonlint -h

Usage: jsonlint [file] [options]

file     file to parse; otherwise uses stdin

Options:
   -v, --version            print version and exit
   -s, --sort-keys          sort object keys
   -i, --in-place           overwrite the file
   -t CHAR, --indent CHAR   character(s) to use for indentation  [  ]
   -c, --compact            compact error display
   -V, --validate           a JSON schema to use for validation
   -e, --environment        which specification of JSON Schema the validation file uses  [json-schema-draft-03]
   -q, --quiet              do not print the parsed json to STDOUT  [false]
   -p, --pretty-print       force pretty printing even if invalid

Module interface

I'm not sure why you wouldn't use the built in JSON.parse but you can use jsonlint from a CommonJS module:

var jsonlint = require("jsonlint");

jsonlint.parse('{"creative?": false}');

It returns the parsed object or throws an Error.

Vim Plugins

MIT License

Copyright (C) 2012 Zachary Carter

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

jison

Bison in JavaScript.
JavaScript
4,338
star
2

orderly.js

An Orderly compiler in JavaScript
JavaScript
118
star
3

reflect.js

Implementation of Mozilla's Parser API in JavaScript
JavaScript
110
star
4

jsxgettext

Extract gettext calls from JavaScript, EJS, and other template formats.
JavaScript
105
star
5

ebnf-parser

A parser for BNF and EBNF grammars used by jison
JavaScript
80
star
6

jison-lex

generates lexical analyzers. used by jison.
JavaScript
57
star
7

selfie

Take webcam selfies with node.js.
JavaScript
42
star
8

node-fx-sync

Node.js client for Firefox Sync
JavaScript
28
star
9

npm-seal

Verify that packages installed during development match those installed in production
JavaScript
26
star
10

lex-parser

A parser for lexical grammars used by jison.
JavaScript
25
star
11

zii-jsconf2010-talk

Slides and code from my track B talk "Build Your Own Programming Language with JavaScript"
JavaScript
25
star
12

lambdacalc

A simple example of an interpreter in JS. Evaluates lambda calculus expressions.
JavaScript
15
star
13

ukanren.js

ยตKanren in JavaScript
JavaScript
13
star
14

cafe

Brewing up some JavaScript. (DEPRECATED: use/fork reflect.js)
JavaScript
13
star
15

webrates

#owfa project
CSS
11
star
16

jsonic

A homoiconic language based on LISP 1.5/SICP Scheme interpreters. The syntax is JSON.
JavaScript
10
star
17

dabblescript

Dabble with JavaScript syntax
JavaScript
7
star
18

jison2json

grammar.y -> grammar.json
JavaScript
6
star
19

5edm

end-to-end encrypted messaging on deno
TypeScript
6
star
20

node-webcam-capture

Capture frames from your webcam.
Objective-C
6
star
21

sml-hw

Homework for my Programming Languages class, Fall '08
6
star
22

codetch-ext

Codetch, a code editing extension to Firefox, Flock, etc.
JavaScript
6
star
23

webgl-dump

how does webgl
JavaScript
5
star
24

node-simplepush

JavaScript
5
star
25

dotvim

My vim configuration
Vim Script
4
star
26

jsxgettext-recursive

Recursively extract strings for localization.
JavaScript
4
star
27

json2jison

converts JSON grammars into jison's text format
JavaScript
3
star
28

reflect-unbuilder

An AST-to-source-code serializer for reflect.js
JavaScript
3
star
29

execbin

Execute commands and binary files on Android
3
star
30

narwhal-xpcshell

Run narwhal through xpcshell/xulrunner engine
JavaScript
2
star
31

mixinjs

An attempt at multiple inheritance in JavaScript
JavaScript
2
star
32

ml-coursera-hw

andrew ng machine learning coursera course homework
MATLAB
2
star
33

simplepush-browser-client

rough thing for testing. nothing to see here.
JavaScript
2
star
34

bigint-browserify

bigint-browserify
JavaScript
2
star
35

the-status-quo

the status quo
2
star
36

floop.js

An example FlooP to JavaScript/asm.js compiler
JavaScript
2
star
37

reflect-tree-builder

A more tree-like AST builder for reflect.js
JavaScript
2
star
38

typal

Makes prototypal/classical patterns in JavaScript easier. Plus some AOP sugar.
2
star
39

zaach.github.com

where the heart is
HTML
2
star
40

slingshot

Project generator
Python
1
star
41

reflect-builder

Default AST builder for reflect.js
JavaScript
1
star
42

zaach

1
star
43

5edm-eliza

TypeScript
1
star
44

sjcl-codec-bytes

workaround for the missing bytes codec in sjcl builds
JavaScript
1
star