File Coverage

blib/lib/Acme/CPANModules/JSONVariants.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Acme::CPANModules::JSONVariants;
2              
3 1     1   371881 use strict;
  1         1  
  1         32  
4 1     1   4 use warnings;
  1         2  
  1         52  
5              
6 1     1   11951 use Acme::CPANModulesUtil::Misc;
  1         604  
  1         182  
7              
8             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
9             our $DATE = '2024-05-10'; # DATE
10             our $DIST = 'Acme-CPANModules-JSONVariants'; # DIST
11             our $VERSION = '0.002'; # VERSION
12              
13             my $text = <<'MARKDOWN';
14             JSON is hugely popular, yet very simple. This has led to various extensions or
15             variants of JSON.
16              
17             An overwhelmingly popular extension is comments, because JSON is used a lot in
18             configuration. Another popular extension is dangling (trailing) comma.
19              
20             This list catalogs the various JSON variants which have a Perl implementation on
21             CPAN.
22              
23              
24             1) **JSON5**. , "JSON for Humans". Allowing more
25             whitespaces, single-line comment (C++-style), multiline comment (C-style),
26             single quote for strings, hexadecimal number literal (e.g. 0x123abc), leading
27             decimal point, trailing decimal point, positive sign in number, trailing commas.
28              
29             Perl modules: , .
30              
31              
32             2) **HJSON**. , Human JSON. A JSON variant that aims to be
33             more user-friendly by allowing comments, unquoted keys, and optional commas.
34             It's designed to be easier to read and write by humans.
35              
36             Perl modules: (none so far).
37              
38              
39             3) **JSONC**. . JSON with Comments. Also allows
40             unquoted string values with whitespace as delimiters.
41              
42             Perl modules: (none so far).
43              
44              
45             4) **jsonc**. .
46             Another "JSON with Comments", supported by Microsoft Visual Code.
47              
48             Perl modules: (none so far).
49              
50              
51             5) **CSON**. . CofeeScript Object Notation.
52             JSON-like data serialization format inspired by CoffeeScript syntax. It allows
53             for a more concise representation of data by leveraging CoffeeScript's features
54             such as significant whitespace and optional commas.
55              
56             Perl modules: (none so far).
57              
58              
59             6) **RJSON**. . Relaxed JSON. Trailing commas,
60             Optional commas, comments (C-style and C++-style), single-quoted &
61             backtick-quoted strings as well as bare/unquoted, hash key without value (value
62             will default to `undef`). It touts itself as "going beyond other JSON variants,
63             including JSON5."
64              
65             Perl modules: .
66              
67              
68             7) ****. Basically just allowing for trailing commas.
69              
70              
71             8) **JSONLines**. . A more restrictive JSON format, all
72             JSON records must fit in one line as newline is the record delimiter. Encoding
73             must be UTF-8. Convention for line-oriented processing which support JSON. E.g.
74             for CSV replacement.
75              
76             Perl moduless: .
77              
78              
79             9) **YAML**. . YAML is a superset of JSON. It allows for
80             indentation-based syntax and various features like references, heredocs, etc.
81              
82             Perl modules: , , among others.
83              
84              
85             MARKDOWN
86              
87             our $LIST = {
88             summary => 'List of JSON variants/extensions',
89             description => $text,
90             tags => ['task'],
91             };
92              
93             Acme::CPANModulesUtil::Misc::populate_entries_from_module_links_in_description;
94              
95             1;
96             # ABSTRACT: List of JSON variants/extensions
97              
98             __END__