Adding async/defer attribute on module scripts

Is it possible to add async/defer tag on scripts being added by a module? I checked the module documentation and it seems there’s no option for it. I tried using js_render_options but it doesn’t seem to work.

Here’s my module meta.json code:

{
 "global" : false,
 "icon" : "fontawesome-5.14.0:Images:SOLID",
 "host_template_types" : [ "PAGE" ],
 "module_id" : 54869248124,
 "css_assets" : [ {
 "path" : "../../css/glide.core.min.css",
 "name" : "glide.core.min.css"
 }, {
 "path" : "../../css/glide.theme.min.css",
 "name" : "glide.theme.min.css"
 } ],
 "js_assets" : [ {
 "path" : "../../js/glide.min.js",
 "name" : "glide.min.js"
 }, {
 "path" : "../../js/fslightbox.js",
 "name" : "fslightbox.js"
 } ],
 "js_render_options" : {
 "position": "footer",
 "async": true
 },
 "label" : "Gallery",
 "is_available_for_new_content" : true
}

@marth

I don’t think so, but I am not 100% sure

@miljkovicmisa , do you know?

Yes, this is possible! Here’s how your require_js function call should look:

{{ require_js(get_asset_url("https://example.com/cdn/"), { position: "footer", defer: true }) }}