{"id":22276028,"url":"https://github.com/juliyvchirkov/async-resolve","last_synced_at":"2026-05-08T14:02:40.509Z","repository":{"id":57185634,"uuid":"122684773","full_name":"juliyvchirkov/async-resolve","owner":"juliyvchirkov","description":"The bootstrap template to resolve dependencies of an js app before its invocation","archived":false,"fork":false,"pushed_at":"2022-12-16T13:05:38.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T08:32:00.291Z","etag":null,"topics":["async","async-functions","async-programming","asynchronous","asynchronous-programming","bootstrap","browser","dependencies","dependency","dependency-manager","javascript","js","template","wrapper"],"latest_commit_sha":null,"homepage":"","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/juliyvchirkov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"liberapay":"juliyvchirkov"}},"created_at":"2018-02-23T23:50:44.000Z","updated_at":"2025-06-12T12:17:55.000Z","dependencies_parsed_at":"2023-01-29T14:00:20.674Z","dependency_job_id":null,"html_url":"https://github.com/juliyvchirkov/async-resolve","commit_stats":null,"previous_names":["juliyvchirkov/async-js-bootstrap-template"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/juliyvchirkov/async-resolve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliyvchirkov%2Fasync-resolve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliyvchirkov%2Fasync-resolve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliyvchirkov%2Fasync-resolve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliyvchirkov%2Fasync-resolve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juliyvchirkov","download_url":"https://codeload.github.com/juliyvchirkov/async-resolve/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juliyvchirkov%2Fasync-resolve/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001051,"owners_count":26082991,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["async","async-functions","async-programming","asynchronous","asynchronous-programming","bootstrap","browser","dependencies","dependency","dependency-manager","javascript","js","template","wrapper"],"created_at":"2024-12-03T14:13:12.351Z","updated_at":"2025-10-09T08:32:34.134Z","avatar_url":"https://github.com/juliyvchirkov.png","language":"JavaScript","funding_links":["https://liberapay.com/juliyvchirkov"],"categories":[],"sub_categories":[],"readme":"# Async js bootstrap template\n\n**The bootstrap template to resolve dependencies of an js app before its invocation while that app along w/ dependencies are loaded asynchronously** \u003ca href=\"https://github.com/juliyvchirkov/async-js-bootstrap-template/releases/tag/v0.0.21\"\u003e\u003cimg src=\"https://github.com/favicon.ico\" width=\"20\" height=\"20\" valign=\"middle\" \u003e\u003c/a\u003e \u003ca href=\"https://www.npmjs.com/package/async-js-bootstrap-template\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/6078720?s=20\u0026v=4\" width=\"20\" height=\"20\" valign=\"middle\"\u003e\u003c/a\u003e\n\nThis working concept implements the solution to avoid the niggling trouble of asynchronous loading in browser when an app itself are loaded \u0026 invoked faster than the whole bunch of its dependencies\n\nThe bootstrap is not limited to modern browsers \u0026 can be safely utilized w/ legacies (IE9 \u0026 above are in, IE8 \u0026 below require [additional polyfill](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every#Polyfill))\n\n## The template\n\n```javascript\n'use strict'\n\n;(function (global, factory) {\n    ;(function bootstrap () {\n        return [].every(function (dependency) {\n            var context = global\n            var proppath = dependency.split('.')\n            \n            while (proppath.length) {\n                context = context[proppath.shift()]\n                if (!/[fo]/.test((typeof context)[0])) {\n                    return false\n                }\n            }\n            \n            return true\n        }) ? factory() : setTimeout(bootstrap, 100)\n    })()\n})(this, function () {})\n```\n\nOnce more, this time  [w/ comments](async-js-bootstrap-template.js)\n\n```javascript\n'use strict'\n\n/**\n * The outer frame of the whole thing\n *\n * @param {object}   global  The global namespace (i.e. “window” / “self”)\n * @param {function} factory An app\n *\n * @returns {void}\n */\n;(function (global, factory) {\n    /**\n     * Resolves dependencies of an app. Invokes that app as soon as \n     * all dependencies are resolved\n     *\n     * @returns { … } Invoked app if its dependencies are completely\n     *                resolved, itself deferred for 0.1s otherwise\n     */\n    ;(function bootstrap () {\n        return [\n            /**\n             * The array of strings\n             *\n             * Each string defines a dependency to be resolved\n             * (like “_”, “FormValidation.Framework.Bootstrap”,\n             * “jQuery.fn.modal” etc)\n             *\n             * Dependencies gotta be defined by their complete\n             * namespace relative to the global one. The order\n             * of dependencies within the array doesn't matter\n             */\n        ].every(function (dependency) {\n            var context = global\n            var proppath = dependency.split('.')\n\n            while (proppath.length) {\n                context = context[proppath.shift()]\n                if (!/[fo]/.test((typeof context)[0])) {\n                    return false\n                }\n            }\n\n            return true\n        }) ? factory() : setTimeout(bootstrap, 100)\n    })()\n})(this, function () {\n    /**\n     * An app code goes here\n     */\n})\n\n```\n\n## Samples\n\nThe sample below resolves 4 dependencies\n\n- [Lodash utility library](https://github.com/lodash/lodash)\n- [jQuery library](https://github.com/jquery/jquery)\n- [jQuery plugin Lazy](https://github.com/eisbehr-/jquery.lazy)\n- [FastClick polyfill](https://github.com/ftlabs/fastclick)\n\n```javascript\n'use strict'\n\n;(function (global, factory) {\n    ;(function bootstrap () {\n        return [\n            '_',\n            'jQuery',\n            'jQuery.fn.lazy',\n            'FastClick'\n        ].every(function (dependency) {\n            var context = global\n            var proppath = dependency.split('.')\n            \n            while (proppath.length) {\n                context = context[proppath.shift()]\n                if (!/[fo]/.test((typeof context)[0])) {\n                    return false\n                }\n            }\n            \n            return true\n        }) ? factory() : setTimeout(bootstrap, 100)\n    })()\n})(this, function () {\n    /**\n     * An app code goes here\n     */\n})\n```\n\nThe next sample resolves the dependency \u0026 then passes its instance to an app on invocation\n\n```javascript\n'use strict'\n\n;(function (global, factory) {\n    ;(function bootstrap () {\n        return ['jQuery'].every(function (dependency) {\n            var context = global\n            var proppath = dependency.split('.')\n            \n            while (proppath.length) {\n                context = context[proppath.shift()]\n                if (!/[fo]/.test((typeof context)[0])) {\n                    return false\n                }\n            }\n            \n            return true\n        }) ? factory(jQuery) : setTimeout(bootstrap, 100)\n    })()\n})(this, function ($) {\n    $(function () {\n        /**\n          * An app code goes here\n          */\n    })\n})\n```\n\n## Bugs\n\nIf you have faced some bug, please [follow this link to create the issue](https://github.com/juliyvchirkov/async-js-bootstrap-template/issues) \u0026 thanks for your time \u0026 contribution in advance!\n\n**Glory to Ukraine!** 🇺🇦\n\nJuliy V. Chirkov,\n[twitter.com/juliychirkov](https://twitter.com/juliychirkov)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliyvchirkov%2Fasync-resolve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliyvchirkov%2Fasync-resolve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliyvchirkov%2Fasync-resolve/lists"}