{"id":19589187,"url":"https://github.com/fasttime/core-commonjs","last_synced_at":"2025-10-15T16:46:28.387Z","repository":{"id":65281439,"uuid":"589002316","full_name":"fasttime/core-commonjs","owner":"fasttime","description":"A polyfill for `require`, `__dirname` and `__filename` in ES modules in Node.js","archived":false,"fork":false,"pushed_at":"2023-01-14T18:51:12.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-24T11:55:58.216Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fasttime.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-14T18:39:22.000Z","updated_at":"2023-01-14T18:59:24.000Z","dependencies_parsed_at":"2023-01-16T05:45:36.320Z","dependency_job_id":null,"html_url":"https://github.com/fasttime/core-commonjs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fasttime%2Fcore-commonjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fasttime%2Fcore-commonjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fasttime%2Fcore-commonjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fasttime%2Fcore-commonjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fasttime","download_url":"https://codeload.github.com/fasttime/core-commonjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240860170,"owners_count":19869288,"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-11T08:17:37.298Z","updated_at":"2025-10-15T16:46:23.343Z","avatar_url":"https://github.com/fasttime.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# core-commonjs · [![npm version][npm badge]][npm URL]\n\n**core-commonjs** adds support for [`require`](https://nodejs.org/api/modules.html#requireid), [`__dirname`](https://nodejs.org/api/modules.html#__dirname) and [`__filename`](https://nodejs.org/api/modules.html#__filename) to ES modules in Node.js.\n\n## Installation\n\nInstall with [npm](https://docs.npmjs.com/about-npm):\n```shell\nnpm i core-commonjs\n```\n\n## Usage\n\nImport once at the entry point of your application/running unit:\n\n```js\n// main.js\nimport 'core-commonjs';\nimport './app.js';\n```\n\nUse in all ES modules later on:\n\n```js\n// app.js\nconst express = require('express');\nconst app = express();\napp.get('/', (req, res) =\u003e res.send('Hello World from ' + __dirname));\napp.listen(80);\n\nexport default app;\n```\n\nAlternatively, launch with `node -r core-commonjs ./app.js` to have core-commonjs preloaded by Node.js.\n\n## Compatibility\n\ncore-commonjs works in Node.js 14 or later. Browsers and transpilers are not supported.\n\n[npm badge]: https://badge.fury.io/js/core-commonjs.svg\n[npm URL]: https://www.npmjs.com/package/core-commonjs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffasttime%2Fcore-commonjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffasttime%2Fcore-commonjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffasttime%2Fcore-commonjs/lists"}