{"id":16667952,"url":"https://github.com/chenglou/require-polyfill","last_synced_at":"2025-10-01T06:30:47.144Z","repository":{"id":47714737,"uuid":"85808545","full_name":"chenglou/require-polyfill","owner":"chenglou","description":"Make `require` work in browsers, at runtime. No code bundling needed!","archived":false,"fork":false,"pushed_at":"2021-08-16T22:18:42.000Z","size":8,"stargazers_count":43,"open_issues_count":4,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-30T02:06:09.295Z","etag":null,"topics":["browser","polyfill","require"],"latest_commit_sha":null,"homepage":null,"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/chenglou.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":"2017-03-22T09:21:49.000Z","updated_at":"2024-08-29T19:46:18.000Z","dependencies_parsed_at":"2022-09-16T09:41:51.957Z","dependency_job_id":null,"html_url":"https://github.com/chenglou/require-polyfill","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenglou%2Frequire-polyfill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenglou%2Frequire-polyfill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenglou%2Frequire-polyfill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenglou%2Frequire-polyfill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenglou","download_url":"https://codeload.github.com/chenglou/require-polyfill/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234833322,"owners_count":18893888,"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":["browser","polyfill","require"],"created_at":"2024-10-12T11:15:39.838Z","updated_at":"2025-10-01T06:30:46.853Z","avatar_url":"https://github.com/chenglou.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Require Polyfill\n\nThis simple script is inspired by [require1k](http://stuk.github.io/require1k/), with a few flaws fixed (works with npm3, reads package.json's `main` field, etc.).\n\n## Usage\n\nDrop it into a script tag like so:\n\n```js\n\u003cscript src=\"./path/to/require_polyfill.js\" data-main=\"./path/to/entry/file\" data-project-root=\"./\"\u003e\u003c/script\u003e\n```\n\nWhere `data-project-root` is where `node_modules` is located.\n\nTada! All your js files' `require` statements will work! No watcher, no code bundling, no hassle.\n\n**Note**: This is only meant to be used as a development time convenience.\n\n**Note2**: On browsers like Chrome that disallow cross origin requests, we can't load directly from the file system. Start a local server in that case. Alternatively, try Safari or Firefox!\n\n\n## Known Issues\n\n- Doesn't polyfill the node.js libraries. So e.g. `require('fs')` would fail.\n\n- Doesn't support code splitting. Kidding, it supports all the code splitting.\n\n- Doesn't have a logo (TODO: create an entire community around this script).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenglou%2Frequire-polyfill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenglou%2Frequire-polyfill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenglou%2Frequire-polyfill/lists"}