Saturday, January 2, 2021

What is JSON5

The JSON5 Data Interchange Format (JSON5) is a superset of JSON that aims to alleviate some of the limitations of JSON by expanding its syntax to include some productions from ECMAScript 5.1.


The following ECMAScript 5.1 features, which are not supported in JSON, have been extended to JSON5.

Objects

Object keys may be an ECMAScript 5.1 IdentifierName.

Objects may have a single trailing comma.

Arrays

Arrays may have a single trailing comma.

Strings

Strings may be single quoted.

Strings may span multiple lines by escaping new line characters.

Strings may include character escapes.

Numbers

Numbers may be hexadecimal.

Numbers may have a leading or trailing decimal point.

Numbers may be IEEE 754 positive infinity, negative infinity, and NaN.

Numbers may begin with an explicit plus sign.

Comments

Single and multi-line comments are allowed.

White Space

Additional white space characters are allowed.


Short Example

{

  // comments

  unquoted: 'and you can quote me on that',

  singleQuotes: 'I can use "double quotes" here',

  lineBreaks: "Look, Mom! \

No \\n's!",

  hexadecimal: 0xdecaf,

  leadingDecimalPoint: .8675309, andTrailing: 8675309.,

  positiveSign: +1,

  trailingComma: 'in objects', andIn: ['arrays',],

  "backwardsCompatible": "with JSON",

}




References:

https://json5.org/


1 comment:

  1. -- Living Mobile --: What Is Json5 >>>>> Download Now

    >>>>> Download Full

    -- Living Mobile --: What Is Json5 >>>>> Download LINK

    >>>>> Download Now

    -- Living Mobile --: What Is Json5 >>>>> Download Full

    >>>>> Download LINK U8

    ReplyDelete