{"id":21916374,"url":"https://github.com/dsheiko/micro-requirejs","last_synced_at":"2025-04-18T21:54:22.454Z","repository":{"id":8057019,"uuid":"9468585","full_name":"dsheiko/micro-requirejs","owner":"dsheiko","description":"⛔️ [DEPRECATED] Tiny asynchronous dependency loader, that does not require modification of dependent scripts","archived":false,"fork":false,"pushed_at":"2022-12-07T17:49:22.000Z","size":376,"stargazers_count":22,"open_issues_count":6,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-20T08:06:39.897Z","etag":null,"topics":["depricated","obsolete","script-loader"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsheiko.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":"2013-04-16T09:06:15.000Z","updated_at":"2021-10-04T18:16:53.000Z","dependencies_parsed_at":"2022-09-12T04:21:38.404Z","dependency_job_id":null,"html_url":"https://github.com/dsheiko/micro-requirejs","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheiko%2Fmicro-requirejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheiko%2Fmicro-requirejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheiko%2Fmicro-requirejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsheiko%2Fmicro-requirejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsheiko","download_url":"https://codeload.github.com/dsheiko/micro-requirejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226971309,"owners_count":17711414,"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":["depricated","obsolete","script-loader"],"created_at":"2024-11-28T19:17:42.742Z","updated_at":"2024-11-28T19:17:43.442Z","avatar_url":"https://github.com/dsheiko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Micro RequireJS v2.0\r\n==============\r\n[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\r\n\r\n\u003e WARNING - THIS PROJECT IS NO LONGER MAINTAINED!!!\r\n\r\n[![NPM](https://nodei.co/npm/micro-requirejs.png)](https://nodei.co/npm/micro-requirejs/)\r\n\r\n[![Build Status](https://travis-ci.org/dsheiko/micro-requirejs.png?branch=master)](https://travis-ci.org/dsheiko/micro-requirejs)\r\n[![Bower version](https://badge.fury.io/bo/micro-requirejs.svg)](http://badge.fury.io/bo/micro-requirejs)\r\n\r\nExtremely simple and light-weight (**\u003c1KB** gzipped) asynchronous resource (JavaScript and CSS) loader\r\n\r\nIf you need support of legacy (like ancient) browsers, go with micro-requirejs v1.x\r\n\r\n## How to use\r\n\r\n```html\r\n\u003c!DOCTYPE html\u003e\r\n\u003chtml\u003e\r\n\u003cbody\u003e\r\n...\r\n\u003cscript src=\"./rjs.js\"\u003e\u003c/script\u003e\r\n\u003cscript type=\"text/javascript\"\u003e\r\nrjs([ \r\n    \"https://code.jquery.com/jquery-3.3.1.slim.min.js\",\r\n    \"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css\"     \r\n    ])\r\n    .then(() =\u003e {\r\n        console.log( \"jQuery available, Bootstrap CSS available.\" );\r\n        return rjs(\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js\")\r\n            .then(() =\u003e {\r\n                console.log( \"Bootstrap JS available.\" );\r\n            });\r\n    })\r\n    .catch(( err ) =\u003e {\r\n        console.error( \"Something went wrong\", err );\r\n    });\r\n\u003c/script\u003e\r\n\u003c/body\u003e\r\n\u003c/html\u003e\r\n```\r\n\r\n### Async function style\r\n```js\r\nasync function main() {\r\n\r\n    try {\r\n        await rjs([ \r\n            \"https://code.jquery.com/jquery-3.3.1.slim.min.js\",\r\n            \"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css\"            \r\n        ]);\r\n        await rjs( \"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js\" );\r\n        console.log( \"jQuery and Bootstrap loaded\" );\r\n    } catch ( err ) {\r\n        console.error( err );\r\n    }\r\n}\r\n\r\nmain();\r\n```\r\n\r\n### Injecting extra attributes\r\n```js\r\n// Single source\r\n await rjs( \"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js\", {\r\n            integrity: \"sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy\",\r\n            crossorigin: \"anonymous\"\r\n        });\r\n\r\n// Multiple sources\r\n await rjs([ \r\n            [\"https://code.jquery.com/jquery-3.3.1.slim.min.js\", {\r\n                integrity: \"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo\",\r\n                crossorigin: \"anonymous\"\r\n            }],\r\n            \"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css\"            \r\n        ]);        \r\n\r\n```\r\n\r\nYou can run tests like that:\r\n```\r\nnpm test\r\n```\r\n\r\n[![Analytics](https://ga-beacon.appspot.com/UA-1150677-13/dsheiko/micro-requirejs)](http://githalytics.com/dsheiko/micro-requirejs)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsheiko%2Fmicro-requirejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsheiko%2Fmicro-requirejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsheiko%2Fmicro-requirejs/lists"}