{"id":20930703,"url":"https://github.com/intermine/intermine-api-loader","last_synced_at":"2026-04-30T05:37:42.415Z","repository":{"id":3163653,"uuid":"4194376","full_name":"intermine/intermine-api-loader","owner":"intermine","description":"Simplify loading of JS and CSS dependencies","archived":false,"fork":false,"pushed_at":"2013-05-29T12:49:43.000Z","size":503,"stargazers_count":1,"open_issues_count":6,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-30T12:44:52.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"divio/django-filer","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intermine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-01T17:10:43.000Z","updated_at":"2013-12-10T13:06:02.000Z","dependencies_parsed_at":"2022-08-20T10:10:10.497Z","dependency_job_id":null,"html_url":"https://github.com/intermine/intermine-api-loader","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/intermine/intermine-api-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intermine%2Fintermine-api-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intermine%2Fintermine-api-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intermine%2Fintermine-api-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intermine%2Fintermine-api-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intermine","download_url":"https://codeload.github.com/intermine/intermine-api-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intermine%2Fintermine-api-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32456167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"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":[],"created_at":"2024-11-18T21:35:48.234Z","updated_at":"2026-04-30T05:37:37.401Z","avatar_url":"https://github.com/intermine.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#InterMine API Loader\n\nSimplify loading of JS and CSS dependencies.\n\n[ ![Codeship Status for intermine/intermine-api-loader](https://www.codeship.io/projects/3543c3f0-9498-0130-d02b-2af0f23c7f6c/status?branch=master)](https://www.codeship.io/projects/3085)\n\n## Quickstart\n\nInclude `intermine.api.js` on a page then resolve dependencies as follows:\n\n```javascript\nintermine.load({\n  'js': {\n    'JSON': {\n      'path': 'http://cdn.intermine.org/js/json3/3.2.2/json3.min.js'\n    },\n    'setImmediate': {\n      'path': 'http://cdn.intermine.org/js/setImmediate/1.0.1/setImmediate.min.js'\n    },\n    'example': {\n      'path': 'http://',\n      'test': function() {\n        return true;\n      }\n    },\n    'async': {\n      'path': 'http://cdn.intermine.org/js/async/0.2.6/async.min.js',\n      'depends': ['setImmediate']\n    },\n    'jQuery': {\n      'path': 'http://cdn.intermine.org/js/jquery/1.8.2/jquery.min.js',\n      'depends': ['JSON']\n    },\n    '_': {\n      'path': 'http://cdn.intermine.org/js/underscore.js/1.3.3/underscore-min.js',\n      'depends': ['JSON']\n    },\n    'Backbone': {\n      'path': 'http://cdn.intermine.org/js/backbone.js/0.9.2/backbone-min.js',\n      'depends': ['jQuery', '_']\n    }\n  }\n});\n```\n\n## Build your Own\n\n```bash\n$ npm install\n$ make build\n```\n\n## Test in CLI\n\n```bash\n$ npm install\n$ make test\n```\n\n## Spec\n\n1. Each dependency to load is grouped under either a `css` or `js` key.\n2. A dependency is loaded only if it does not exist on the page already. There are two ways to determine that:\n  1. Check the name key of the library as to whether or not it is exposed on the `window` object.\n  1. If a `test` function is provided, run it and continue only if we get `false` back.\n3. URL to the dependency is defined under the `path` key.\n4. A dependency will be resolved only after all dependencies are met which is defined in an Array under `depends` key.\n5. If two requests to load dependency X come at the same time we make only one load and use cache for the second.\n6. CSS is a bit random so we just load whatever you ask for not waiting for anything.\n7. Keys `load` and `loader` are taken over by us on the `intermine` namespace.\n8. **The last parameter of `load` is a callback. Use it, it might respond with an error.**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintermine%2Fintermine-api-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintermine%2Fintermine-api-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintermine%2Fintermine-api-loader/lists"}