16.0.0 (2024-08-09)
- Use Object.hasOwn instead of Object.prototype.hasOwnProperty (06e7c0f)
The minimum supported version of Node.js is 16.9 now.
15.0.0 (2024-08-09)
- Optionally omit object key proto and others from parsed output (e2f8a7b)
Object key __proto__
and other keys from Object.prototype
are included in the parsed object by default. Earlier, no keys from Object.prototype
were included. The new behaviour is consistent with JSON.parse
. If you need the old behaviour, add the argument ignore-prototype-keys
to the command line, or set the option ignorePrototypeKeys
to true
, when calling the parse
method. If you don't have under control, what will happens with the parsed object, you should consider setting ignoreProtoKey
to true
, when calling the parse
method, to prevent prototype pollution.
14.1.0 (2024-08-09)
- Assume --trailing-commas if --trim-trailing-commas is requested (b3fb10d)
- Add options to sort object keys by locale, numerically and ignoring the letter case (4387c4b)
- Exit the process with 0 (success) if no files were found and
--succeed-with-no-files
was requested (923f37f)
- Upgrade dependencies (355aad5)
14.0.3 (2023-04-27)
14.0.2 (2023-03-08)
14.0.1 (2023-03-07)
- Prevent setting a constant variable (c7e940c)
14.0.0 (2023-03-05)
- Replace commander with hand-written command-line parser (af0ea29)
- Although you shouldn't notice any change on the behaviour of the command line, something unexpected might've changed. Something did change: if you're annoyed by inserting "--" between the multi-value option and other arguments, you don't have to do it any more. Multi-value options can be entered either using the option prefix multiple times for each value, or using the option prefix just once and separating the values by commas.
13.1.0 (2023-03-05)
- Accept multiple schemas if external definitions are used (32d1cab)
13.0.1 (2023-03-05)
- Replace ajv@6 with ajv-draft-04 (b1535a3)
13.0.0 (2023-03-05)
- Support JSON Schema drafts 2019-09 and 2020-12 and JSON Type Definition (0b9130c)
- The default environment recognises only JSON Schema drafts 06 and 07 automatically. Not 04 any more. The environment for JSON Schema drafts 04 has to be selected explicitly. Also, JSON Schema drafts 06 and 07 are handled by AJV@8 instead of AJV@6. It shouldn't make any difference, but the implementation is new and could perform a stricter validation.
12.0.0 (2023-03-05)
- Upgrade dependencies and require Node.js 14 (87205c2)
- Dropped support for Node.js 12 . The minimum supported version is Node.js 14.
11.7.2 (2023-03-05)
- Use both typings and types in package.json (5d00c00)
11.7.1 (2023-03-05)
- Complete TypeScript types (7064c50)
11.7.0 (2022-09-26)
- Upgrade npm dependencies (81526ce)
- Ignore the leading UTF-8 byte-order mark (BOM) (311c6df)
11.6.0 (2022-05-04)
- Do not generate text diff if not needed (0423a4b)
- Allow setting the line count as diff context (9b22843)
11.5.0 (2022-05-03)
- Do not print file names twice in the compact mode (86691cc)
- Add option "diff" to print the difference instead of the output (cb3826c)
11.4.0 (2022-05-03)
- Introduce a check that the formatted output is the same as the input (75167f7)
11.3.0 (2022-05-03)
- Fix the regex splitting input by line breaks (7423806)
- Read options from configuration files (7eebd76)
11.2.0 (2022-05-01)
- Allow logging only the name of processed files (91346d9)
- Allow to continue processing in case of error (e5318eb)
- Support BASH patterns to specify input files (31d162f)
11.1.1 (2022-05-01)
- Retain the original last line break in the processed file (54fd5ab)
11.1.0 (2022-05-01)
- Merge remote-tracking branch 'xmedeko/patch-1' (da3e1dc)
- Optionally ensure a line break at the end of the output (226019e)
11.0.0 (2022-05-01)
- Upgrade dependencies (0d35969)
- The minimum supported version has become Node.js 12 instead of the previous Node.js 6. At least
commander
needs the new version.
10.2.0 (2019-12-28)
- Allow trimming trailing commas in arrays and objects (JSON5) (136ea99)
- Allow unifying quotes around object keys to double or single ones (JSON5) (6b6da17)
10.1.1 (2019-12-27)
- Restore compatibility with IE11 (55b8a48)
10.1.0 (2019-12-27)
- Alternatively accept number of spaces for the indent parameter (4c25739)
10.0.2 (2019-12-27)
- Do not modify input options in the tokenize method (7e3ac0b)
10.0.1 (2019-12-27)
- Pretty-printer: keep the comment after opening an object scope indented (4fbc09d)
10.0.0 (2019-12-27)
- Rename the property "exzerpt" in error information to "excerpt" (4c74e3d)
- Add support for pretty-printing of the JSON input (d5eaa93)
-
If you used the property "exzerpt" from the parsing error object, you have to change it to "excerpt". It should be easy using a full-text search in your sources.
-
The option for pretty-printing invalid input has been renamed:
-p (--pretty-print) ==> -P (--pretty-print-invalid)
The option -p (--pretty-print)
will newly prettify the raw (text) input instead of formatting the parsed JSON object.
9.0.0 (2019-12-22)
- Upgrade package dependencies (4a8f2d9)
- Add TypeScript typings (ba6c979)
- Dependencies (commander, at least) dropped support for Node.js 4. Node.js 6 should still work, but officially it is not supported either. You should upgrade to the current or still supported Node.js LTS version.
8.0.3 (2019-09-24)
- Upgrade package dependencies and adapt sources (9f1f332)
8.0.2 (2019-07-04)
- Put only the reason of the error to the error.reason property when the custom parser is used; not the full message including the error context (8d7f0b1)
- Update newline replacement regex to show correct error position on Windows (7af364c)
8.0.0 (2019-06-16)
- Give the schema-drafts.js proper name and path in source maps (c2f0148)
- Add the tokenize method returning tokens instead of the parsed object (cc7b554)
- Improve schema error reporting to the level of data parsing (ea5a8a2)
- Remove deprecated exports
Parser
andparser
(8bda5b1)
- The
Parser
class andparser
instance did not bring any benefit. They were generated by Jison. After abandoning the Jison parser they were kept for compatibility only. The only method on theParser
prototype was theparse
. It remains unchanged as a direct export. Drop the class interface and just call theparse
method directly.
7.0.3 (2019-06-03)
- Ensure, that tokens and keys in error messages are enclosed in quotation marks (2149198)
7.0.2 (2019-06-02)
- Upgrade minificating module (04d80d7)
7.0.1 (2019-06-02)
- Recognize boxed string as schema environment too (e37b004)
7.0.0 (2019-06-02)
- Do not use the native parser in Safari and Node.js 4 (a4a606c)
- Include the minified scripts used on the on-line page in the NPM module (03561ec)
- Add "mode" parameter to set flags for a typical format type easier (9aa09fb)
- Add an option for ignoring trailing commas in object and arrays (7d521fb)
- Add an option for reporting duplicate object keys as an error (09e3977)
- Replace the parser generated by Jison with a hand-built parser from JJU (2781670)
- Support
reviver
from the nativeJSON.parse
method (83cd33c)
- There is no
yy.parseError
to intercept error handling. Use the thrown error - it contains all available information. The error does not include thehash
object with structured information. Look for the documentd properties. The location of the error occurrence is available aslocation.start
, for example.
DEPRECATION: The only exposed object to use from now on is the parse
method as a named export. Other exports (parser
and Parser
) are deprecated and will be removed in future.
The parser from "Utilities to work with JSON/JSON5 documents" is four times faster, than the previous one, has approximatly the same size and can be easier enhanced, regarding both features and error handling.
6.3.1 (2019-05-31)
- Recognise the location of error occurrences in Firefox (7c8c040)
6.3.0 (2019-05-30)
- Auto-detect the version of the JSON Schema draft by default (1fe98ef)
- Prefer the native JSON parser, if possible, to improve performance (1639356)
- Support parser options for customisation and performance in JSON schema parsing too (d562826)
6.2.1 (2019-05-30)
- Include source code in source maps on the on-line validator page (31e0097)
6.2.0 (2019-05-30)
- Extract the functionality for sorting object keys to a module (a53bd93)
6.1.0 (2019-05-27)
- Fix the missing function object (Parser) in the main module exports (eb892aa)
- Restore context options (yy) set in the Parser constructor after the call to parse, if the options were overridden by the method arguments (787c350)
- Use the native JSON parser if a limited error information is enough (8aa9fb1)
6.0.0 (2019-05-26)
- Declare modules in this package using UMD (d442583)
- Remove ParserWithComments and parseWithComment from the interface (3fab374)
- The object and the method do not exist any more. Pass the parameter "ignoreComments" as an object
{ ignoreComments: true }
either to the constructor of theParser
object, or as the second parameter to the methodparse
.
5.0.0 (2019-05-26)
- Do not export "main" method, which requires other NPM modules (d8af36a)
- Accept single quotes (apostrophes) as string delimiters (240b8cd)
- The "main" method providing a command-line interface importable from other module has been removed. If you used it, have a look at the command-line interface in
lib/cli
. You can import this module in instead and it offers a richer interface, than the previously exported "main" method. Thelib/cli
module is mapped tobin/jsonlint
too. However, consider the default library export (lib/jsonlint
) for programmatic usage. You will pack less JavaScript code and use smalker, mode programmer-oriented interface.
4.0.2 (2019-05-19)
- Print parsing errors if the JSON input is read from stdin (acfdf11)
4.0.1 (2019-05-19)
- Do not fail sorting objects with a property called "hasOwnProperty" (b544ceb)
4.0.0 (2019-05-19)
- Standardize the interface of the "jsonlint/lib/formatter" module (b8b041b)
- Add web and programmatic interfaces to JSON Schema validation (d45b243)
- The formatting method is exposed not as exports.formatter.formatJson, but as exports.format. This module is not documented and it is unlikely, that it broke other project.
3.0.0 (2019-05-18)
- Replace JSON schema validator JSV with ajv, because JSV is not maintained any more and does not support current JSON schema drafts (1a4864f)
- The environment for the JSON schema validation "json-schema-draft-03" is not available any more. Migrate your schemas from the JSON schema draft 03 to 04 or newer. Drafts 04, 06 and 07 are supported with this release.
2.0.1 (2019-05-18)
- Do not depend on the standard checker in the release package (1e9c7b5)
2.0.0 (2019-05-18)
- Accept any file extension on the command line directly (14ba31c)
- Do not distribute the web directory in the npm module (7379be8)
- Make the compact-errors mode working with the latest Jison output (d417a9c)
- Rename the long name of the option "extension" to "extensions" (383e50a)
- Replace nomnom as command-line parser with commander, which is maintaitained (6694bba)
- Report the right file name in the compact-errors mode, if multiple files or directories are engtered (7c80326)
- Add a checkbox to recognize JavaScript-style comments to the web page (2a9082a)
- Support parsing and skipping JavaScript-style comments in the JSON input (4955c58)
- The options "extension" is not recognized any more. Use the option "extensions" with the same semantics instead.
1.7.0 (2019-05-18)
- Allow specifying JSON file extensions for directory walk (d8e8076)
This is the first version released after forking the original project.