{"id":15353645,"url":"https://github.com/mifi/commonify","last_synced_at":"2025-09-13T19:37:13.726Z","repository":{"id":53930801,"uuid":"451360934","full_name":"mifi/commonify","owner":"mifi","description":"Recursively publish ESM packages as CommonJS!","archived":false,"fork":false,"pushed_at":"2022-05-05T21:09:34.000Z","size":34,"stargazers_count":32,"open_issues_count":4,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-28T12:21:19.601Z","etag":null,"topics":["cjs","commonjs","esm","transpiler"],"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/mifi.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":"2022-01-24T07:32:16.000Z","updated_at":"2024-02-21T12:13:20.000Z","dependencies_parsed_at":"2022-08-13T04:50:13.781Z","dependency_job_id":null,"html_url":"https://github.com/mifi/commonify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mifi%2Fcommonify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mifi%2Fcommonify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mifi%2Fcommonify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mifi%2Fcommonify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mifi","download_url":"https://codeload.github.com/mifi/commonify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248983936,"owners_count":21193667,"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":["cjs","commonjs","esm","transpiler"],"created_at":"2024-10-01T12:14:47.200Z","updated_at":"2025-04-15T00:30:45.374Z","avatar_url":"https://github.com/mifi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Commonify.js\n\nFor us who are still relying on CommonJS, or using Electron [which does not support ESM](https://github.com/electron/electron/issues/21457).\n\n🆕 See also [build-electron](https://github.com/mifi/build-electron)\n\nI made this tool that makes it easy to:\n- Pull any ESM package from npm\n- Transpile it from ESM to CommonJS using babel\n- Publish it under a custom npm scope\n- Recursively do the same for all dependencies\n\n**It is mostly an experiment**, and it feels like a step back in terms of the ecosystem moving to ESM, so if anyone has any other great ideas, please submit an issue! I have thought about the possibility of doing something similar to the `node_modules` folder in an npm `postinstall` script.\n\n## Usage\n\nFirst create your scope here: https://www.npmjs.com/org/create\n\n```bash\ngit clone https://github.com/mifi/commonify.git\ncd commonify\n\nyarn\nnode cli.mjs lowdb 3.0.0 myscope\n```\nThis will create the package `@myscope/lowdb` and its dependencies ready to publish to npm.\n\n## Example packages\n\nI will publish commonified packages to the `@commonify` scope:\n- `@commonify/lowdb`\n- `@commonify/steno`\n- `@commonify/execa`\n- `@commonify/strip-final-newline`\n- `@commonify/onetime`\n- `@commonify/mimic-fn`\n- `@commonify/npm-run-path`\n- `@commonify/path-key`\n- `@commonify/is-stream`\n\n## Todo\n\n- **Support already scoped packages**\n- Must support dual modules (they also have `\"type\": \"module\"` set). Example: https://github.com/yargs/yargs-parser/blob/main/package.json \n- Automate when upstream package version updates\n- Auto-generate a list of versions and their version corresponding to upstream version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmifi%2Fcommonify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmifi%2Fcommonify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmifi%2Fcommonify/lists"}