{"id":15433002,"url":"https://github.com/simonw/download-esm","last_synced_at":"2025-04-13T21:36:59.668Z","repository":{"id":160169485,"uuid":"635108053","full_name":"simonw/download-esm","owner":"simonw","description":"Download ESM modules from npm and jsdelivr","archived":false,"fork":false,"pushed_at":"2023-07-25T07:47:56.000Z","size":17,"stargazers_count":94,"open_issues_count":5,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-18T07:53:42.265Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonw.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":"2023-05-02T01:36:22.000Z","updated_at":"2024-10-10T23:09:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"3c74693a-8ccd-4991-a653-f6fd0a1b3851","html_url":"https://github.com/simonw/download-esm","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/simonw%2Fdownload-esm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fdownload-esm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fdownload-esm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fdownload-esm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonw","download_url":"https://codeload.github.com/simonw/download-esm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788743,"owners_count":21161726,"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-10-01T18:30:13.467Z","updated_at":"2025-04-13T21:36:59.646Z","avatar_url":"https://github.com/simonw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# download-esm\n\n[![PyPI](https://img.shields.io/pypi/v/download-esm.svg)](https://pypi.org/project/download-esm/)\n[![Changelog](https://img.shields.io/github/v/release/simonw/download-esm?include_prereleases\u0026label=changelog)](https://github.com/simonw/download-esm/releases)\n[![Tests](https://github.com/simonw/download-esm/workflows/Test/badge.svg)](https://github.com/simonw/download-esm/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/download-esm/blob/master/LICENSE)\n\nDownload ESM modules from npm and jsdelivr\n\nSee [download-esm: a tool for downloading ECMAScript modules](https://simonwillison.net/2023/May/2/download-esm/) for background on this project.\n\n## Installation\n\nInstall this tool using `pip`:\n\n    pip install download-esm\n\n## Warning\n\nThis is **alpha software**. It works for downloading Observable Plot, but has not been tested against many other packages yet.\n\n[Your help welcome](https://github.com/simonw/download-esm/issues/2) in testing this further!\n\n## Usage\n\nTo download Observable Plot and all of its dependencies as ECMAScript modules:\n\n    download-esm @observablehq/plot\n\nThis will download around 40 `.js` files to the current directory.\n\nTo put them in another directory, add that as an argument:\n\n    download-esm @observablehq/plot ./js\n\nEach file will have any `import` and `export` statements rewritten as relative paths.\n\nYou can then use the library in your own HTML and JavaScript something like this:\n\n```html\n\u003cdiv id=\"myplot\"\u003e\u003c/div\u003e\n\u003cscript type=\"module\"\u003e\nimport * as Plot from \"./js/observablehq-plot-0-6-6.js\";\nconst plot = Plot.rectY(\n    {length: 10000}, Plot.binX({y: \"count\"}, {x: Math.random})\n).plot();\nconst div = document.querySelector(\"#myplot\");\ndiv.append(plot);\n\u003c/script\u003e\n```\n\n## Development\n\nTo contribute to this tool, first checkout the code. Then create a new virtual environment:\n\n    cd download-esm\n    python -m venv venv\n    source venv/bin/activate\n\nNow install the dependencies and test dependencies:\n\n    pip install -e '.[test]'\n\nTo run the tests:\n\n    pytest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonw%2Fdownload-esm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonw%2Fdownload-esm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonw%2Fdownload-esm/lists"}