{"id":18355407,"url":"https://github.com/charto/cresolve","last_synced_at":"2025-04-10T01:37:26.912Z","repository":{"id":88491862,"uuid":"133708511","full_name":"charto/cresolve","owner":"charto","description":"Node-style module resolution for SystemJS","archived":false,"fork":false,"pushed_at":"2018-11-19T03:40:46.000Z","size":35,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T22:08:19.895Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/charto.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-16T18:36:06.000Z","updated_at":"2019-10-09T16:17:43.000Z","dependencies_parsed_at":"2023-06-26T00:54:16.218Z","dependency_job_id":null,"html_url":"https://github.com/charto/cresolve","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fcresolve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fcresolve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fcresolve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charto%2Fcresolve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charto","download_url":"https://codeload.github.com/charto/cresolve/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248141398,"owners_count":21054450,"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":[],"created_at":"2024-11-05T22:06:51.063Z","updated_at":"2025-04-10T01:37:26.896Z","avatar_url":"https://github.com/charto.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cresolve\n\nThis library hooks SystemJS `resolve` to extend it with Node.js module resolution.\nIt also looks in [UNPKG](https://unpkg.com/) to load packages without installing them.\n\nCustom SystemJS configuration is automatically generated in the browser.\nSaving it to a file allows vanilla SystemJS to load the project,\nso this library is only needed in development.\nIt solves pretty much all SystemJS configuration issues.\n\n## Features\n\n- Works in the browser, using `XMLHttpRequest` instead of native file IO.\n- Looks for `node_modules` and inside, in the same places Node.js would.\n- Automatic [UNPKG](https://unpkg.com/) fallback when package is not yet installed.\n- Handles `browser` mappings in `package.json` files.\n- Allows importing a directory when it contains `index.js`.\n- Transpiles ES6 using TypeScript compiler (by default).\n- Automatically tries `.tsx` if a file with `.ts` extension is missing.\n- Generates SystemJS configuration JSON to easily eliminate dependency on this library and switch to vanilla SystemJS.\n\n## Usage\n\nFirst load a Promise polyfill (if needed), SystemJS and the SystemJS -format bundle provided under\n[`dist/index-system.js`](https://unpkg.com/cresolve@1/dist/index-system.js) for example using `\u003cscript\u003e` tags.\n\nThen import the resolver and patch SystemJS as follows:\n\n```TypeScript\nSystem.import('cresolve').then(function(cresolve) {\n\tconst resolver = new cresolve.Resolver(\n\t\tcresolve.ifExists,\n\t\tcresolve.fetch\n\t);\n\n\tresolver.patchSystem(System);\n});\n```\n\nAfterwards, `System.import` and any `import` or `require` statements in imported code have Node.js module resolution superpowers.\n\nTo print the auto-generated configuration, use:\n\n```TypeScript\nconsole.log(JSON.stringify(resolver.systemConfig, null, '\\t'));\n```\n\n# License\n\n[The MIT License](https://raw.githubusercontent.com/charto/cresolve/master/LICENSE)\n\nCopyright (c) 2018- BusFaster Ltd\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharto%2Fcresolve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharto%2Fcresolve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharto%2Fcresolve/lists"}