D
D
doggames_offical2022-03-12 10:45:51
JavaScript
doggames_offical, 2022-03-12 10:45:51

I don't understand how to do it?

How to use object from vk api messages getConversationmMembers, and save to json

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
defriz, 2022-03-12
@defriz

use fs module and save this object to json file

const fs = require('fs');
const json = require('./file.json'); // в этом файле []

let object = await /*здесь вводишь этот АПИ метод с нужными параметрами*/
json.push(object); // добавляем в массив (из файла file.json) объект, только что полученный запросом.
fs.writeFileSync("./file.json", JSON.stringify(file, null, "\t")); // перезаписываем данные из переменной file в file.json

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question