{"id":13447357,"url":"https://github.com/egoist/import-http","last_synced_at":"2025-05-15T14:04:47.127Z","repository":{"id":34054154,"uuid":"167972602","full_name":"egoist/import-http","owner":"egoist","description":"Import modules from URL instead of local node_modules","archived":false,"fork":false,"pushed_at":"2023-01-04T00:39:47.000Z","size":1286,"stargazers_count":1239,"open_issues_count":45,"forks_count":37,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-15T03:53:55.580Z","etag":null,"topics":["esmodules","module","rollup","webpack"],"latest_commit_sha":null,"homepage":null,"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/egoist.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":"2019-01-28T14:07:18.000Z","updated_at":"2025-02-11T15:50:53.000Z","dependencies_parsed_at":"2023-01-15T04:30:25.328Z","dependency_job_id":null,"html_url":"https://github.com/egoist/import-http","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fimport-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fimport-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fimport-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fimport-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egoist","download_url":"https://codeload.github.com/egoist/import-http/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355334,"owners_count":22057354,"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":["esmodules","module","rollup","webpack"],"created_at":"2024-07-31T05:01:15.317Z","updated_at":"2025-05-15T14:04:47.110Z","avatar_url":"https://github.com/egoist.png","language":"JavaScript","readme":"\u003cimg src=\"https://user-images.githubusercontent.com/8784712/51839289-d122a380-2343-11e9-90b8-bc2756c5dee9.png\" alt=\"logo\"\u003e\n\n---\n\n[![NPM version](https://badgen.net/npm/v/import-http)](https://npmjs.com/package/import-http) [![NPM downloads](https://badgen.net/npm/dm/import-http)](https://npmjs.com/package/import-http) [![CircleCI](https://badgen.net/circleci/github/egoist/import-http/master)](https://circleci.com/gh/egoist/import-http/tree/master) [![donate](https://badgen.net/badge/support%20me/donate/ff69b4)](https://github.com/sponsors/egoist) [![chat](https://badgen.net/badge/chat%20on/discord/7289DA)](https://chat.egoist.sh)\n\n**Please consider [donating](https://github.com/sponsors/egoist) to this project's author, [EGOIST](#author), to show your ❤️ and support.**\n\n## Introduction\n\n- Imports source code URLs! Like `\u003cscript type=\"module\"\u003e` and [Deno](https://github.com/denoland/deno) but implemented as a webpack/Rollup plugin. Embracing the future :)\n\n  ```js\n  import template from 'https://unpkg.com/lodash-es/template'\n\n  console.log(template(`Hello \u003c%= name %\u003e`)({ name: 'EGOIST' }))\n  ```\n\n  Remote code is fetched and cached on first build, and never updated until\n  you use the `reload` option. See more about [Caching](#caching).\n\n- No more `node_modules` bloat, no dependency to install.\n\n![image](https://unpkg.com/@egoist/media/projects/import-http/preview.svg)\n\n## Install\n\n```bash\nyarn add import-http --dev\n```\n\n## Usage\n\n### Webpack\n\nIn your `webpack.config.js`:\n\n```js\nconst ImportHttpWebpackPlugin = require('import-http/webpack')\n\nmodule.exports = {\n  plugins: [new ImportHttpWebpackPlugin()]\n}\n```\n\nThat's it, try following code:\n\n```js\nimport React from 'https://unpkg.com/react'\nimport Vue from 'https://unpkg.com/vue'\n\nconsole.log(React, Vue)\n```\n\nRun webpack and it just works.\n\n### Rollup\n\nIn your `rollup.config.js`:\n\n```js\nexport default {\n  plugins: [require('import-http/rollup')()]\n}\n```\n\n## Caching\n\nResources will be fetched at the very first build, then the response will be cached in `~/.cache/import-http` dir. You can use the `reload` option to invalidate cache:\n\n```js\nconst ImportHttpWebpackPlugin = require('import-http/webpack')\n\nmodule.exports = {\n  plugins: [\n    new ImportHttpWebpackPlugin({\n      reload: process.env.RELOAD\n    })\n  ]\n}\n```\n\nThen run `RELOAD=true webpack` to update cache.\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## Author\n\n**import-http** © EGOIST, Released under the [MIT](./LICENSE) License.\u003cbr\u003e\nAuthored and maintained by EGOIST with help from contributors ([list](https://github.com/egoist/import-http/contributors)).\n\n\u003e [Website](https://egoist.sh) · GitHub [@EGOIST](https://github.com/egoist) · Twitter [@\\_egoistlily](https://twitter.com/_egoistlily)\n","funding_links":["https://github.com/sponsors/egoist"],"categories":["JavaScript","目录"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Fimport-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegoist%2Fimport-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Fimport-http/lists"}