{"id":15069897,"url":"https://github.com/bigpipe/async-asset","last_synced_at":"2025-04-10T17:05:15.231Z","repository":{"id":57185443,"uuid":"20843309","full_name":"bigpipe/async-asset","owner":"bigpipe","description":"Async asset loading for browsers, because async loading is hard.","archived":false,"fork":false,"pushed_at":"2018-04-26T13:56:09.000Z","size":54,"stargazers_count":3,"open_issues_count":6,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-24T14:46:16.169Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigpipe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-14T22:27:00.000Z","updated_at":"2016-02-26T12:42:59.000Z","dependencies_parsed_at":"2022-09-06T04:10:55.717Z","dependency_job_id":null,"html_url":"https://github.com/bigpipe/async-asset","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fasync-asset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fasync-asset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fasync-asset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2Fasync-asset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigpipe","download_url":"https://codeload.github.com/bigpipe/async-asset/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248260168,"owners_count":21074207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-25T01:45:24.901Z","updated_at":"2025-04-10T17:05:15.212Z","avatar_url":"https://github.com/bigpipe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# async-asset\n\nAsynchronously load front-end assets. And with async, we mean truly async.\nLoading scripts async isn't that hard but loading a CSS file fully async in\na cross browser manner can be utterly painful. Especially when you try to do\nthis in the front-end's worst enemy, Internet Explorer. It has limitations on\nthe amount of style sheets that can be loaded on a single page. So we need to\nmake sure that we do not reach these limitations by using clever tricks. (Which\nwe are doing of course).\n\n## Installation\n\nThis module exposes a Node.js (`module.exports`) interface for loading the module\nso you should be using `browserify` to compile the assets in to a single file.\nThe code it self is released through `npm` as you might have expected and can be\ninstalled by running:\n\n```\nnpm install --save async-asset\n```\n\n## Usage\n\nRequire the module:\n\n```js\n'use strict';\n\nvar AsyncAsset = require('async-asset');\n```\n\nAnd construct a new instance.\n\n```js\nvar assets = new AsyncAsset(root, { options });\n```\n\nIn the function signature above you can see that it receives 2 arguments:\n\n1. The `root` element where we append all script/link instances to.\n2. The `options` object which allows you further configure the object. The\n   following options are accepted:\n   - `document` Document instance where we call the `createElement` on.\n   - `timeout` Amount of milliseconds we allow the resource to load until call\n     all callbacks with an timeout error.\n   - `onload` Indication if style sheets call the `onload` method.\n   - `prefix` Prefix for id selectors we used to pull for style sheet changes.\n\n### AsyncAsset.remove\n\n```js\nassets.remove(url, fn);\n```\n\n### AsyncAsset.add\n\n```js\nassets.add(url, fn);\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigpipe%2Fasync-asset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigpipe%2Fasync-asset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigpipe%2Fasync-asset/lists"}