{"id":19724002,"url":"https://github.com/wraith13/evil-commonjs","last_synced_at":"2025-07-21T04:32:55.667Z","repository":{"id":83857399,"uuid":"161735838","full_name":"wraith13/evil-commonjs","owner":"wraith13","description":"CommonJS is a symbol of fxxking JavaScript! ( evil-commonjs is a simple commonjs implement. )","archived":false,"fork":false,"pushed_at":"2025-06-29T04:48:37.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-29T05:27:20.343Z","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":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wraith13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_1_0.txt","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-12-14T05:28:21.000Z","updated_at":"2025-06-29T04:48:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"c5d7c982-e6d8-4bab-a81a-d6bf9538a223","html_url":"https://github.com/wraith13/evil-commonjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wraith13/evil-commonjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wraith13%2Fevil-commonjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wraith13%2Fevil-commonjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wraith13%2Fevil-commonjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wraith13%2Fevil-commonjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wraith13","download_url":"https://codeload.github.com/wraith13/evil-commonjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wraith13%2Fevil-commonjs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266240906,"owners_count":23898062,"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-11T23:24:12.111Z","updated_at":"2025-07-21T04:32:55.662Z","avatar_url":"https://github.com/wraith13.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# evil-commonjs\n\nevil-commonjs is a simple commonjs implement.\n\n## Usage by TypeScript\n\nCopy [`index.ts`](index.ts) as `evil-commonjs/index.ts` or `evil-commonjs.ts` into your TypeScript project ( and change `tsconfig.json` if necessary ).\n\nand\n\n```typescript\nawait window.module.load(\"aaa/bbb/index.js\", [\"bbb\"]); // aaa depends on bbb.\nawait window.module.load(\"aaa/index.js\", [\"aaa\"]);\n```\n\nor\n\n```typescript\nawait window.module.sequentialLoad\n([\n    { path:\"aaa/bbb/index.js\", mapping:[\"bbb\"] }, // aaa depends on bbb.\n    { path:\"aaa/index.js\", mapping:[\"aaa\"] },\n]);\n```\n\nYou can now use `window.require(\"aaa\")` and `import aaa from 'aaa'` !\n\nSpecify a relative path from `location.href` or a absolute path for first parameter of `window.module.load()`.\n\n```typescript\nawait window.module.load(\"aaa/bbb/index.js\", [\"bbb\"]); // aaa depends on bbb.\nconst aaa = await window.module.load(\"aaa/index.js\");\n```\n\nLike this, you can also get directly from `window.module.load()` without using `require`.\n\n## Usage by JavaScript\n\n```html\n\u003cscript src=\"https://wraith13.github.io/evil-commonjs/index.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nwindow.module.sequentialLoad\n([\n    { path:\"aaa/bbb/index.js\", mapping:[\"bbb\"] }, // aaa depends on bbb.\n    { path:\"aaa/index.js\", mapping:[\"aaa\"] },\n]).then\n(\n    map =\u003e\n    {\n        var aaa = require(\"aaa/index.js\");\n        ...\n    }\n);\n\u003c/script\u003e\n```\n\nYou can also use like this style.\n\n## Console log settings\n\nYou can specify console output settings as follows.\n\n```html\n\u003cscript\u003e\nconst evilCommonjsConfig =\n{\n    log:\n    {\n        config: false,\n        load: true,\n        define: true,\n        readyToCapture: true,\n        results: false,\n    },\n    loadingTimeout: 1500,\n};\n\u003c/script\u003e\n\u003cscript src=\"https://wraith13.github.io/evil-commonjs/index.js\"\u003e\u003c/script\u003e\n```\n\nAll individual settings are optional.\n\n### on URL\n\nYou can also specify console output settings on URL. Note that the arguments here must be valid as JSON.( 🚫 `...?evil-commonjs={loadingTimeout:1500,}` → ✅ `...?evil-commonjs={\"loadingTimeout\":1500}` )\n\n```url\nhttps://example.com/your-page-path?evil-commonjs={\"log\":{\"config\":false,\"load\":true,\"define\":true,\"results\":false},\"loadingTimeout\":1500}\n```\n\n## How to build\n\nrequires: [Node.js](https://nodejs.org/), [TypeScript Compiler](https://www.npmjs.com/package/typescript)\n\n`tsc -P .` or `tsc -P . -w`\n\n### In VS Code\n\nYou can use automatic build. Run `Tasks: Allow Automatic Tasks in Folder` command from command palette ( Mac: \u003ckbd\u003eF1\u003c/kbd\u003e or \u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eCommand\u003c/kbd\u003e+\u003ckbd\u003eP\u003c/kbd\u003e, Windows and Linux: \u003ckbd\u003eF1\u003c/kbd\u003e or \u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eP\u003c/kbd\u003e), and restart VS Code.\n\n## License\n\n[Boost Software License](LICENSE_1_0.txt)\n\n## Related projects\n\n- [evil-tsconfig.paths.ts](https://github.com/wraith13/evil-tsconfig.paths.ts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwraith13%2Fevil-commonjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwraith13%2Fevil-commonjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwraith13%2Fevil-commonjs/lists"}