Questions tagged [json5]

JSON5 is a superset of JSON that has a more flexible syntax. Use this tag for questions specifically related to the JSON5 standard, and NOT questions that are ONLY about regular JSON.

JSON5 is a superset of JSON that has a more flexible syntax that aligns with ES5 syntax (the version of Javascript most commonly used today). In addition to everything JSON supports, it adds:

  • unquoted property keys
  • single-quoted, escaped and multi-line strings
  • alternate number formats
  • comments
  • extra whitespace

The JSON5 reference implementation (json5 npm package) provides a JSON5 object that has parse and stringify methods with the same args and semantics as the built-in JSON object.

22 questions
0
votes
0 answers

Parse json files with comments? (keybindings.json)

Does VSCode provides any means to parse json files with comments without using external library? I'm trying get list of keybindings for the extension and need to parse keybindings.json file, which contains comments I'm currently using JSON5 package,…
vanowm
  • 9,466
  • 2
  • 21
  • 37
0
votes
1 answer

ValueError exception "п" while reading .json file with json5

Currently, I am trying to make the simplest JSON5 reader in PyCharm that reads files from certain windows paths. What I have encountered is a completely unknown for me error that seemingly appears out of nowhere right after I try to read a JSON5 for…
V0W4N
  • 3
  • 1
0
votes
0 answers

Using variables with YAML in Node.js

Is there any way to parse data to a .yaml file in node.js? I've been searching about this for hours and found nothing useful. Let's say I have a string in a .yaml file: message: Hello, ${user.fullName}, have a nice day. As I've been reading,…
YahiaRefaiea
  • 172
  • 1
  • 12
0
votes
3 answers

How do I parse this non-standard JSON format?

I want to know some process information ran on the VPS with PM2. But, with the JSON string return by PM2, we can't run JSON.parse() because the JSON is broken. An example of what PM2 returns: '{data: 0, informations: "hello", name: "test"}' But, if…
Pioupia
  • 339
  • 2
  • 15
0
votes
2 answers

React Native Could not read path @babel\core\node_modules\json5\.bin\json5

I cannot build the project for android. When ever I run the gradlew assembleRelease, I get the following error: Failed to capture snapshot of input files for task ':app:bundleReleaseJsAndAsset s' property '$1' during up-to-date check. Could not…
MohamadKh75
  • 2,582
  • 5
  • 28
  • 54
0
votes
1 answer

Error while parsing JSON - Unexpected EOF at line 1 column 2 of the JSON5 data. when I npm run build

When I npm run build in my Vue.js project, I get bellow error: ERROR in ./src/vendors.js Module build failed: SyntaxError: /home/ldl/repo/vue_admin_site/.babelrc: Error while parsing JSON - Unexpected EOF at line 1 column 2 of the JSON5 data. Still…
sof-03
  • 2,255
  • 4
  • 15
  • 33
-1
votes
2 answers

How to get only first element in list contained in string?

I've got a long string. This string contains a list, like such example '[{"ex1": 0, "ex2":1}, {"ex3": 2, "ex4":3}]' I can use json5.loads and then get the first element by using [0] on the list, but json5.loads takes a long time for longer strings.…
cold10
  • 130
  • 8
1
2