{"id":28456610,"url":"https://github.com/maple3142/require-unpkg","last_synced_at":"2025-06-29T10:32:53.226Z","repository":{"id":65489129,"uuid":"102924571","full_name":"maple3142/require-unpkg","owner":"maple3142","description":"require from unpkg.com in browser","archived":false,"fork":false,"pushed_at":"2020-06-02T06:55:12.000Z","size":1233,"stargazers_count":4,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-06T23:08:18.090Z","etag":null,"topics":["browser","javascript","module","require","unpkg"],"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/maple3142.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":"2017-09-09T03:41:39.000Z","updated_at":"2024-12-08T09:27:43.000Z","dependencies_parsed_at":"2023-01-25T16:55:13.930Z","dependency_job_id":null,"html_url":"https://github.com/maple3142/require-unpkg","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/maple3142/require-unpkg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maple3142%2Frequire-unpkg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maple3142%2Frequire-unpkg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maple3142%2Frequire-unpkg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maple3142%2Frequire-unpkg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maple3142","download_url":"https://codeload.github.com/maple3142/require-unpkg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maple3142%2Frequire-unpkg/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262578359,"owners_count":23331609,"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","javascript","module","require","unpkg"],"created_at":"2025-06-06T23:08:21.258Z","updated_at":"2025-06-29T10:32:53.195Z","avatar_url":"https://github.com/maple3142.png","language":"JavaScript","readme":"# require-unpkg\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/maple3142/require-unpkg.svg)](https://greenkeeper.io/)\n\n[![Build Status](https://travis-ci.org/maple3142/require-unpkg.svg?branch=master)](https://travis-ci.org/maple3142/require-unpkg)\n\n## require from [unpkg.com](https://unpkg.com/) in browser\n\n### [Example](https://rawgit.com/maple3142/require-unpkg/master/test.html)\n\n### [Example(codepen)](https://codepen.io/maple3142/pen/qXebVQ)\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\n\u003chead\u003e\n  \u003cmeta charset=\"UTF-8\"\u003e\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n  \u003cmeta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\"\u003e\n\n  \u003cscript src=\"dist/require.js\"\u003e\u003c/script\u003e\n  \u003c!--cdn--\u003e\n  \u003c!--script src=\"https://unpkg.com/require-unpkg\"\u003e\u003c/script--\u003e\n  \u003ctitle\u003eExample\u003c/title\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n  \u003cdiv id=\"jquery\"\u003e\u003c/div\u003e\n  \u003cdiv id=\"vue\"\u003e\n    \u003cinput type=\"text\" v-model=\"input\"\u003e\n  \u003c/div\u003e\n  \u003cscript\u003e\n    require.cache.expire = 100000; //set cache time (DONT SET TO 0), default: 24 hours\n\n    //with es7 async/await:\n    (async function () {\n      let $ = await require('jquery')\n      $('#jquery').text('jquery hello world')\n    })()\n\n    //with Promise+Array Destructuring:\n    require(['vue','vuejs-storage']).then(([Vue,vuejsStorage]) =\u003e {\n      Vue.use(vuejsStorage)\n      new Vue({\n        el: '#vue',\n        storage: {\n          data: {\n            input: ''\n          },\n          namespace: 'test'\n        }\n      })\n    })\n  \u003c/script\u003e\n\u003c/body\u003e\n\n\u003c/html\u003e\n```\n\n## Extra\n\n### \\_require\n\n`require._require` only require single module only ex: `require._require('jquery')`\n\n### \\_get\n\n`require._get` provide simple xhr `GET` function ex:`require._get(url)`\n\n### node.js\n\nTo use in node.js environment, you must set\n\n```javascript\nconst urequire = require('unpkg-require')\nurequire.XMLHttpRequest = XHR_POLYFILL //like xhr2...\n\nurequire('lodash').then(_ =\u003e {})\n```\n\n~~But I don't know why to require unpkg instead of `node_modules`~~\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaple3142%2Frequire-unpkg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaple3142%2Frequire-unpkg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaple3142%2Frequire-unpkg/lists"}