i have a python script that create a json and i have a nodejs script that read the json:
- python script
with open("music.json", "w") as write_file:
json.dump(music_found, write_file, indent=4)
music_found is an array of object
- nodejs
import fs from 'fs'
import { cwd } from 'process';
let rawdata = fs.readFileSync(`${cwd()}/music.json`);
let music = JSON.parse(rawdata)
console.log(music);
i get the message unexpected end of json input
- json example
[
{
"user": "some_user1",
"file": "@@enlbq\\_Music\\Infected Mushroom\\Return to the Sauce [2017] [HMCD94]\\09 - Infected Mushroom - Liquid Smoke.flac",
"size": 42084572,
"slots": true,
"speed": 1003176
},
{
"user": "some_user2",
"file": "@@xfjpb\\Musiikkia\\Infected Mushroom\\Return to the Sauce\\09 Infected Mushroom - Liquid Smoke.flac",
"size": 24617421,
"slots": true,
"speed": 541950
},
{
"user": "some_user3",
"file": "@@rxjpv\\MyMusic\\Infected Mushroom\\Infected Mushroom - Return To The Sauce (2017) [CD FLAC]\\09 - Liquid Smoke.flac",
"size": 41769608,
"slots": true,
"speed": 451671
}
]
my json is well formatted no ? i'm on that since 4hours and im stuck on it... very annoying ^^ hope somehone help