const instagramJSON = async function() {}
instagramJSON.get = async function(username) {
if(!username) return new Error("Username needed!")
const fetch = require("node-fetch"),
url = "https://instagram.com/" + username + "/?__a=1"
let res = await fetch(url).then(body => body.json())
return res
}
exports = instagramJSON()
Я не знаю, почему это происходит, я не очень продвинутый. на JavaScript так что это может быть легкой ошибкой, которую я сделал, в чем может быть проблема?
TypeError: get is not a function
at Object.<anonymous> (C:\Users\Dimitri\whatever stuff\test\test.js:3:13)
←[90m at Module._compile (internal/modules/cjs/loader.js:1147:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:996:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:896:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m