35
rated 0 times
[
39]
[
4]
/ answers: 1 / hits: 31359
/ 3 Years ago, sun, september 12, 2021, 12:00:00
I'm trying to export a function from a Js file but recieving a Unexpected token
error
const youtubeDownload = require("./youtube/youtube-download"); // export function youtubeDownload
const twitterDonwload = require("./twitter/twitter-download"); // export function twitterDownload
function download(tweet) {
if(tweet.in_reply_to_status_id_str == null) return youtubeDownload(tweet);
if(tweet.in_reply_to_status_id_str != null) return twitterDonwload(tweet);
};
export { download };
This code is returning the error:
export { download };
^^^^^^
SyntaxError: Unexpected token 'export'
More From » function