简体   繁体   中英

How to import API/external JS in a JS file?

I'm coding a web extension for Firefox and I would like to make the same thing as this: https://stackoverflow.com/a/32616807/10452863 , which means use Google API to search random images.

How can I import the Google API in my .js file ?

if you want to try out any npm package, I would suggest googleapis . You can use all Google APIs with this node.js client library.

          To import use ``` const { google } = require("googleapis")```

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM