{"id":16704169,"url":"https://github.com/aazuspan/minee","last_synced_at":"2026-02-11T13:02:56.503Z","repository":{"id":59720213,"uuid":"532448496","full_name":"aazuspan/minee","owner":"aazuspan","description":"📦 Earth Engine module bundler","archived":false,"fork":false,"pushed_at":"2024-10-15T16:40:59.000Z","size":1036,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T10:53:09.584Z","etag":null,"topics":["bundle","cli","code-editor","earth-engine","gee","minify","node"],"latest_commit_sha":null,"homepage":"https://aazuspan.github.io/minee","language":"TypeScript","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/aazuspan.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":"2022-09-04T05:37:01.000Z","updated_at":"2024-10-14T22:49:31.000Z","dependencies_parsed_at":"2024-10-26T04:56:47.107Z","dependency_job_id":"10f26ba2-3380-4f59-9e79-78902d0e1168","html_url":"https://github.com/aazuspan/minee","commit_stats":{"total_commits":41,"total_committers":2,"mean_commits":20.5,"dds":"0.024390243902439046","last_synced_commit":"4d151f288972a1148d9746f9204aa467f858eedf"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/aazuspan/minee","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fminee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fminee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fminee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fminee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aazuspan","download_url":"https://codeload.github.com/aazuspan/minee/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fminee/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29333155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T12:42:24.625Z","status":"ssl_error","status_checked_at":"2026-02-11T12:41:23.344Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bundle","cli","code-editor","earth-engine","gee","minify","node"],"created_at":"2024-10-12T19:11:33.577Z","updated_at":"2026-02-11T13:02:56.485Z","avatar_url":"https://github.com/aazuspan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# minee 📦\n\n[![npm version](https://badge.fury.io/js/minee.svg)](https://badge.fury.io/js/minee)\n\n`minee` is a module bundler for Earth Engine. It takes a module that may contain multiple imported scripts and bundles them into a single compact file for users to import. \n\n![Terminal demo](./assets/minee_demo.gif)\n\nThe diagrams below illustrate bundling with an example module, [geeSharp](https://github.com/aazuspan/geeSharp.js). Before bundling, a user requires the entry module `geeSharp` which requires a network of dependencies. Each `require` call takes time to resolve, leading to slow imports. After bundling, a user imports a single entry file that was pre-bundled by `minee`, reducing file size and import time by [about 70%](#example-results).\n```mermaid\ngraph TD\n    subgraph s2[After Bundling]\n    u2{User}---\u003e|requires|entry2\n    geeSharp-.-\u003em[(minee)];\n    sharpeners2[src/sharpeners.js]-.-\u003em;\n    metrics2[src/metrics.js]-.-\u003em;\n    utils2[src/utils.js]-.-\u003em;\n    m---\u003e|Bundle and minify|entry2(geeSharp);\n    end\n    subgraph s1[Before Bundling]\n    u1{User}--\u003e|requires|entry1(geeSharp)\n    entry1--\u003e|requires|sharpeners1[src/sharpeners.js];\n    entry1--\u003e|requires|metrics1[src/metrics.js];\n    sharpeners1--\u003e|requires|utils1[src/utils.js];\n    metrics1--\u003e|requires|utils1;\n    end\n```\n\n# Setup\n\n## Installation\n\nDownload [Node.js](https://nodejs.org/en/download/), then install `minee` globally with:\n\n```bash\nnpm install -g minee\n```\n\n## Authentication\n\nIf you haven't accessed an Earth Engine repository using `git` from your computer before, you'll need to authenticate first by going to https://earthengine.googlesource.com/new-password and following the instructions. This will store credentials on your computer at `~/.gitcookies` that allows `minee` to grab and bundle repositories.\n\n# Usage\n\n## CLI\n\n```bash\nUsage: minee [options]\n\n📦 Earth Engine module bundler.\n\nOptions:\n  -V, --version       output the version number\n  -e, --entry \u003cpath\u003e  The path to the module entry point, e.g. users/username/repository:module.\n  -d --dest \u003cpath\u003e    The local file path to write the bundled file.\n  --no-minify         Skip minifying code after bundling.\n  --no-header         Drop header information from the bundled file.\n  --keep-names        Avoid changing internal variable names when minifying.\n  -h, --help          display help for command\n```\n\nPass an Earth Engine module path to the `minee` command, with an optional destination path to save the bundled module. For example, the following command...\n\n```bash\nminee --entry=users/aazuspan/geeSharp:geeSharp --dest=./bundled --keep-names\n```\n\n...will download the `users/aazuspan/geeSharp` repository, find any modules required through the `geeSharp` module, bundle them into a single file, and save that to `./bundled`.\n\n### Configuration File\n\nTo avoid entering CLI options every time `minee` is run, you can create a `.minee.json` configuration file in the root of your project where you run `minee`.\n\nThe following options are supported:\n\n| name | type | default | description |\n|---|---|---|---|\n| entry | string |  | Entry path to the Earth Engine module, e.g. `users/username/repo:module` |\n| dest | string |  | Optional local path to write the bundled file. If none is provided, `\u003centry\u003e.bundled.js` will be used. |\n| header | boolean | true | If `true`, a descriptive header is included in the bundled file. |\n| minify | boolean | true | If `true`, the bundle is minified to reduce file size. |\n| keepNames | boolean | false | If `true`, all identifiers are preserved in the bundled source code when minifying. This option has no effect on functionality, but makes the bundled code easier to read and debug at the cost of larger file size.  |\n\nBelow is an example configuration file:\n\n```javascript\n/* .minee.json */\n{\n  \"entry\": \"users/aazuspan/geeSharp:geeSharp\",\n  \"dest\": \"./bundled\",\n  \"keepNames\": true\n}\n```\n\nNow running `minee` with no options will produce the same results as before. `minee` prioritizes CLI options over configuration options, so you can override the configuration file by passing options as needed.\n\n## JavaScript API\n\nThe [documentation](https://aazuspan.github.io/minee/) provides detailed info on the API, but the sections below give a quick guide to get started.\n\n### Bundling a Module\n\nYou can use the [`bundleModule`](https://aazuspan.github.io/minee/functions/bundleModule.html) function to bundle an Earth Engine module through the JavaScript API.\n\n```javascript\nimport { bundleModule } from \"minee\";\n\n// Load and bundle a module from an entry script\nconst bundled = await bundleModule(\"users/aazuspan/geeSharp:geeSharp\", {keepNames: true});\n```\n\nThis returns a [Bundle](https://aazuspan.github.io/minee/classes/Bundle.html) object that contains the bundled source code and other properties. Use the [`Bundle.write`](https://aazuspan.github.io/minee/classes/Bundle.html#write) method to save the bundled source code to a local file.\n\n```javascript\nbundled.write('./bundled.js');\n```\n\n### Loading a Module\n\nFor more control or to use `minee` outside of bundling, you may want to directly load modules with the [`loadModule`](https://aazuspan.github.io/minee/functions/loadModule.html) function.\n\n\n```javascript\nimport { loadModule } from \"minee\";\n\n// Define an entry point to the module\nconst url = \"users/aazuspan/geeSharp:geeSharp\";\n// Load the module and return a Module object.\nconst geesharp = await loadModule(url, {showProgress: true});\n```\n\nAfter cloning any remote repositories, this returns a [Module](https://aazuspan.github.io/minee/classes/Module.html) object that contains information about the requested module and any modules that were required by it.\n\n## Bundling an Existing Module\n\nIf you have an existing module that you want to bundle, the easiest way is to bundle the current entry module, rename that module, and copy-paste the bundled module to replace the old entry module.\n\nHere's an example workflow using a module called `users/johnnyjackson/eetools:tools`:\n\n1. Rename the `tools` module to `entry` in the Code Editor.\n2. Run `minee -e users/johnnyjackson/eetools:entry -d ./tools`.\n3. Copy the contents of `./tools` into a new Earth Engine script called `tools`.\n\nExisting code built on your module will now automatically require the bundled version!\n\n\u003e **Note**\n\u003e Whenever you make changes to modules in your bundled module, you will have to re-bundle it! Using a Git workflow where you make changes locally and push them to Earth Engine (instead of manually copying and pasting) can simplify that process.\n\n## Example Results\n\nI checked file size and import time before and after bundling several different Earth Engine modules to demonstrate possible speed-ups. Import times represent the best cumulative time over three trials using the default CLI options.\n\n| Module             | File Size | Import time |\n|--------------------|:---------:|:-----------:|\n| [fitoprincipe/batch](https://github.com/fitoprincipe/geetools-code-editor) |   -46.1%  |    -74.7%   |\n| [aazuspan/geeSharp](https://github.com/aazuspan/geeSharp.js) | -75.4% | -68.8% |\n| [gena/palettes](https://github.com/gee-community/ee-palettes)      |   -16.9%  |    -63.5%   |\n| [dmlmont/spectral](https://github.com/davemlz/spectral)   |   -44.1%  |    -48.0%   |\n| [jstnbraaten/msslib](https://github.com/gee-community/msslib) |   -78.5%  |    -19.2%   |\n\nAs you can see, the level of improvement varies by module. Modules with lots of documentation show the greatest reduction in file size, while modules with complex file structures show the greatest reduction in import times.\n\n\u003e **Warning**\n\u003e Bundling adds some additional boilerplate code, so file sizes and import times *can* increase for simple, single-file modules.\n\n# Legal Disclaimer\n\nAny modules required through your entry module, including those by other authors, will be bundled into your source code file. Please check the license of any included module before distributing the bundled file. For convenience, `minee` includes a header comment listing the path of all scripts used in the bundle and any licenses marked with a `@license` tag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faazuspan%2Fminee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faazuspan%2Fminee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faazuspan%2Fminee/lists"}