{"id":15413496,"url":"https://github.com/wooorm/npm-esm-vs-cjs","last_synced_at":"2025-04-04T19:08:46.391Z","repository":{"id":66017103,"uuid":"562146583","full_name":"wooorm/npm-esm-vs-cjs","owner":"wooorm","description":"Data on the share of ESM vs CJS on the public npm registry","archived":false,"fork":false,"pushed_at":"2025-02-28T14:03:42.000Z","size":735,"stargazers_count":196,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T18:14:59.614Z","etag":null,"topics":["cjs","esm","npm"],"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/wooorm.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":"funding.yml","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},"funding":{"github":"wooorm"}},"created_at":"2022-11-05T13:03:55.000Z","updated_at":"2025-03-28T10:18:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"9d8f3063-3127-4aba-adf4-d18155ca89ef","html_url":"https://github.com/wooorm/npm-esm-vs-cjs","commit_stats":{"total_commits":36,"total_committers":2,"mean_commits":18.0,"dds":"0.11111111111111116","last_synced_commit":"c0a92334da4979f7614143734bbe7931d2a0dcde"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooorm%2Fnpm-esm-vs-cjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooorm%2Fnpm-esm-vs-cjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooorm%2Fnpm-esm-vs-cjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooorm%2Fnpm-esm-vs-cjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wooorm","download_url":"https://codeload.github.com/wooorm/npm-esm-vs-cjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234921,"owners_count":20905854,"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","esm","npm"],"created_at":"2024-10-01T16:57:24.987Z","updated_at":"2025-04-04T19:08:46.364Z","avatar_url":"https://github.com/wooorm.png","language":"JavaScript","funding_links":["https://github.com/sponsors/wooorm"],"categories":[],"sub_categories":[],"readme":"# npm-esm-vs-cjs\n\n[![Build][badge-build-image]][badge-build-url]\n\nData on the share of ESM vs CJS on the public npm registry.\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Data](#data)\n* [Scripts](#scripts)\n* [Contribute](#contribute)\n* [Security](#security)\n* [License](#license)\n\n## What is this?\n\nThis repository contains (historical) data on\n[high-impact][github-npm-high-impact] (popular)\npackages and what kind of code they expose:\n\n* ESM — such as `type: 'module'` in `package.json`\n* dual — such as both `import` and `require` conditions in export map\n* faux ESM — `module` field in `package.json`,\n  supported by some old bundlers\n* CJS — anything else (except for `@types/*`)\n\n## When should I use this?\n\nUse this data for rough insights on how the shift to ESM is progressing.\nThe data isn’t perfect though.\n\n## Data\n\n[`index.svg`][file-svg]:\n\n![][file-svg]\n\n[`index.csv`][file-csv]:\n\n```text\ndate,total,esm,dual,faux,cjs\n2021-08-24,5617,341,95,832,4349\n2021-11-09,5647,411,119,809,4308\n2022-01-27,5686,439,149,809,4289\n2022-08-01,5734,496,207,791,4240\n2022-11-04,5747,518,216,785,4228\n2023-02-06,6085,568,255,856,4406\n2023-05-29,6240,630,417,783,4410\n2023-08-24,6636,676,473,876,4611\n2023-11-22,6818,734,510,881,4693\n2024-02-20,7042,826,594,893,4729\n2024-05-27,7042,819,736,826,4661\n2024-08-28,7638,923,876,876,4963\n2024-11-27,8087,942,1152,843,5150\n2025-02-28,8472,916,1520,852,5184\n```\n\n\u003e 👉 **Note**:\n\u003e the crawl of `2024-05-27` adjusts several packages that were\n\u003e previously classified incorrectly as dual.\n\n\u003e 👉 **Note**:\n\u003e crawls from before `2022-11-04` use the list of popular packages\n\u003e on the date of `2022-11-04`,\n\u003e as I had the results of all packages,\n\u003e but not which of them were popular back then.\n\u003e Later dates will use a list of what’s popular on that date.\n\n\u003e 👉 **Note**:\n\u003e not all of these packages are popular.\n\u003e There are some false-positives,\n\u003e such that download counts can be gamed,\n\u003e and that `libraries.io` sometimes thinks that a fork of webpack or so is\n\u003e actually webpack.\n\n\u003e 👉 **Note**:\n\u003e while `@types/*` packages are filtered out in the above counts,\n\u003e it is likely that there are other packages included that aren’t really code,\n\u003e particularly in the CJS category (as that’s the default).\n\n## Scripts\n\nThis repo includes scripts to crawl npm and analyze the results.\nYou need a `NPM_TOKEN` environment variable with a token to crawl npm.\n\n[`script/crawl.js`][file-script-crawl] analyzes the `package.json` files of\n`latest` releases of [high-impact][github-npm-high-impact] npm packages.\nThis script finishes in about 5 minutes.\nYou should likely first contribute to `npm-high-impact`,\nwhich can take like 24 hours to complete.\n\n[`script/analyze.js`][file-script-analyze] analyzes the data files and\ngenerates SVG and CSV files from them.\nAfter running that,\nplease copy/paste the new `.csv` into this readme above.\n\n## Contribute\n\nYes please!\nSee [*How to Contribute to Open Source*][opensource-guide-contribute].\n\n## Security\n\nThis package is safe.\n\n## License\n\n[MIT][file-license] © [Titus Wormer][wooorm]\n\n\u003c!-- Definitions --\u003e\n\n[badge-build-image]: https://github.com/wooorm/npm-esm-vs-cjs/workflows/main/badge.svg\n\n[badge-build-url]: https://github.com/wooorm/npm-esm-vs-cjs/actions\n\n[file-csv]: index.csv\n\n[file-license]: license\n\n[file-script-analyze]: script/analyze.js\n\n[file-script-crawl]: script/crawl.js\n\n[file-svg]: index.svg\n\n[github-npm-high-impact]: https://github.com/wooorm/npm-high-impact\n\n[opensource-guide-contribute]: https://opensource.guide/how-to-contribute/\n\n[wooorm]: https://wooorm.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwooorm%2Fnpm-esm-vs-cjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwooorm%2Fnpm-esm-vs-cjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwooorm%2Fnpm-esm-vs-cjs/lists"}