From 07867100c5f8c446ec164f4a9716adba354e43f0 Mon Sep 17 00:00:00 2001 From: Charles Crawford Date: Fri, 15 Jun 2018 14:19:23 -0700 Subject: [PATCH] Update readme with use case for the module interface --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 58a1aa1..dffbb7e 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ jsonlint will either report a syntax error with details or pretty print the sour ## 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: +You can use jsonlint from a CommonJS module: var jsonlint = require("jsonlint"); @@ -48,6 +48,9 @@ I'm not sure why you wouldn't use the built in `JSON.parse` but you can use json It returns the parsed object or throws an `Error`. +While the same can be accomplished with JSON.parse, jsonlint will provide error +friendlier error messages. + ## Vim Plugins * [Syntastic](http://www.vim.org/scripts/script.php?script_id=2736)