{"id":27868051,"url":"https://github.com/luckfunc/resource-save-script","last_synced_at":"2025-09-03T22:42:27.336Z","repository":{"id":268073897,"uuid":"903236734","full_name":"luckfunc/resource-save-script","owner":"luckfunc","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-16T08:09:30.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-04T22:57:09.181Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/resource-save-script?activeTab=readme","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luckfunc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-12-14T04:22:28.000Z","updated_at":"2024-12-16T08:09:34.000Z","dependencies_parsed_at":"2024-12-14T05:32:08.544Z","dependency_job_id":null,"html_url":"https://github.com/luckfunc/resource-save-script","commit_stats":null,"previous_names":["luckfunc/resource-save-script"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luckfunc/resource-save-script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckfunc%2Fresource-save-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckfunc%2Fresource-save-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckfunc%2Fresource-save-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckfunc%2Fresource-save-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luckfunc","download_url":"https://codeload.github.com/luckfunc/resource-save-script/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luckfunc%2Fresource-save-script/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259453488,"owners_count":22860084,"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":"2025-05-04T22:57:09.264Z","updated_at":"2025-09-03T22:42:27.326Z","avatar_url":"https://github.com/luckfunc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"English | [中文](./README_zh.md)\n\n# Resource Saving Script\n\nA Node.js tool for local development that starts a local server while automatically fetching missing remote resource files.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [How It Works](#how-it-works)\n- [Usage Example](#usage-example)\n- [Use Cases](#use-cases)\n\n## Installation\n\n```bash\nnpm install -g resource-save-script\n```\n\n## Usage\n\nOnce installed, use the `h` command in your terminal:\n\n```bash\n# Run on a custom port\nh 8080\n\n# Run on the default port 4000\nh\n```\n\nYou'll be prompted to enter the remote server URL:\n\n```text\n→ Please enter the base URL for resources: https://your-remote-server.com\n```\n\n## How It Works\n\nThe script monitors 404 requests on the local server. When a missing file is detected, it automatically downloads the file from the specified remote server to your local directory.\n\n## Usage Example\n\nLet's say you want to debug a page from `luckfunc.com` locally:\n\n**1. Create and enter project directory**\n```bash\nmkdir my-project\ncd my-project\n```\n\n**2. Download the main page**\n```bash\ncurl -o index.html https://luckfunc.com/\n```\n\n**3. Start the script in your project directory**\n```bash\nh\n# Enter: https://luckfunc.com/\n```\n\n**4. Access the page**\n\nOpen your browser and visit `http://127.0.0.1:4000/index.html`\n\nWhen the page loads, if it references local files like `i18n.js` that don't exist, the script will automatically download them from `luckfunc.com` to your local directory.\n\nTerminal output will show download progress:\n```text\nMissing file detected: /i18n.js\nDownload complete: /path/to/your/project/i18n.js (1234 bytes)\n```\n\nRefresh the page and all resources will load properly.\n\n## Use Cases\n\n- Local debugging of live websites\n- Setting up offline development environments\n- Bulk downloading of static resources\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluckfunc%2Fresource-save-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluckfunc%2Fresource-save-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluckfunc%2Fresource-save-script/lists"}