How to use JS libraries in Google Sheet App Script?
问题 I want to write a custom function in Google Sheet to generate barcodes. How do I import external js libraries (e.g. https://lindell.me/JsBarcode/)? This is what have I so far: function genBarcode(input) { var url = "https://cdn.jsdelivr.net/jsbarcode/3.6.0/JsBarcode.all.min.js"; var js = UrlFetchApp.fetch(url).getContentText(); eval(js); // I want to do something like this // return JsBarcode("#barcode", "Hi world!"); // But Google sheet says JsBarcode is undefine. } 来源: https://stackoverflow