Я пытаюсь прочитать файл с помощью fs readFile, но не получаю возврата
Когда я использую fs.readFile() в файле character.json, который я создал с помощью fs.writeFile(), я не получаю никаких ошибок или возврата.
Персонажи.json:
["Monkey D. Luffy","Roronoa Zoro","Nami","Usopp","Sanji","Tony Tony Chopper","Nico Robin","Franky","Brook","Jinbe","Shanks","Koby","Gaimon","Kaya","Johnny","Yosaku","Zeff","Nojiko","Bell-mère","Higuma","Alvida","Morgan","Helmeppo","Buggy","Kuro","Krieg","Gin","Arlong","Nefertari Vivi","Laboon","Karoo","Dorry","Brogy","Dalton","Kureha","Portgas D. Ace","Igaram","Kohza","Nefertari Cobra","Smoker","Wapol","Mikita","Gem","Marianne","Galdino","Bentham","Zala","Daz Bonez","Crocodile","Mont Blanc Cricket","Conis","Pagaya","Wyper","Gan Fall","Aisa","Montblanc Noland","Kalgara","Bellamy","Enel","Satori","Shura","Gedatsu","Ohm","Iceburg","Paulie","Kokoro","Galley-La Company","Franky Family","Rob Lucci","Kaku","Jabra","Blueno","Kalifa","Fukurou","Kumadori","Spandam","Kuzan","Foxy","Charlotte Lola","Gekko Moriah","Hogback","Absalom","Perona","Oars","Ryuma","Bartholomew Kuma","Keimi","Pappug","Hatchan","Silvers Rayleigh","Worst Generation","Boa Hancock","Emporio Ivankov","Edward Newgate","Marco","Duval","Charlos","Marshall D. Teach","Magellan","Hannyabal","Sakazuki","Kuzan","Borsalino","Sentomaru","Dracule Mihawk","Donquixote Doflamingo","Momonga","Shirahoshi","Neptune","Surume","Shyarly","Trafalgar D. Water Law","Kin'emon","Kozuki Momonosuke","Kurozumi Kanjuro","Chadros Higelyges","Bartolomeo","Cavendish","Rebecca","Kyros","Riku Doldo III","Sabo","Caribou","Hody Jones","Vander Decken IX","Hyouzou","Caesar Clown","Monet","Vergo","Trebol","Diamante","Pica","Senor Pink","Buffalo","Baby 5","Issho","Raizo","Carrot","Pedro","Wanda","Inuarashi","Nekomamushi","Pekoms","Zunesha","Capone Bege","Kaidou","Jack","Charlotte Linlin","Vinsmoke Judge","Charlotte Katakuri","Charlotte Pudding","Charlotte Cracker","Charlotte Smoothie","Charlotte Perospero","Kozuki Oden","Kozuki Hiyori","Kikunojo","Denjiro","Ashura Doji","Kawamatsu","Shinobu","Hyogoro","Shimotsuki Yasuie","Yamato","King","Queen","Who's-Who","Black Maria","Sasaki","Page One","Ulti","Scratchmen Apoo","Numbers"]
код
const fs = require('fs/promises');
fs.readFile('characters.json', 'utf-8', (err, data) =>{
if(err){
console.log(err)
}
console.log(data)
});