{"id":42226912,"url":"https://github.com/xqin/block-core-js-postinstall","last_synced_at":"2026-01-27T02:36:22.411Z","repository":{"id":152487168,"uuid":"254540211","full_name":"xqin/block-core-js-postinstall","owner":"xqin","description":"Block core-js spam in postinstall","archived":false,"fork":false,"pushed_at":"2020-04-10T04:26:12.000Z","size":1004,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-01-30T11:44:41.356Z","etag":null,"topics":["ads","core-js","garbage","postinstall","spam"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/xqin.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}},"created_at":"2020-04-10T04:02:12.000Z","updated_at":"2020-04-10T04:32:47.000Z","dependencies_parsed_at":"2023-09-25T01:51:20.733Z","dependency_job_id":null,"html_url":"https://github.com/xqin/block-core-js-postinstall","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"972f253bf6dc9cb92f8978ee09e46f7d30599899"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xqin/block-core-js-postinstall","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqin%2Fblock-core-js-postinstall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqin%2Fblock-core-js-postinstall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqin%2Fblock-core-js-postinstall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqin%2Fblock-core-js-postinstall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xqin","download_url":"https://codeload.github.com/xqin/block-core-js-postinstall/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xqin%2Fblock-core-js-postinstall/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28796982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"online","status_checked_at":"2026-01-27T02:00:07.755Z","response_time":168,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ads","core-js","garbage","postinstall","spam"],"created_at":"2026-01-27T02:36:21.742Z","updated_at":"2026-01-27T02:36:22.397Z","avatar_url":"https://github.com/xqin.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# block-core-js-postinstall\n\n## 使用方法\n\n### 打补丁\n\n```\ncurl -s https://raw.githubusercontent.com/xqin/block-core-js-postinstall/master/npm.sh | bash -\n```\n\n### 恢复原样\n\n```\ncurl -s https://raw.githubusercontent.com/xqin/block-core-js-postinstall/master/npm.sh | RESTORE=1 bash -\n```\n\n## 原理\n\n通过给 `npm` 的 `postinstall.js` 文件添加自定义代码, 来实现屏蔽 `npm` 执行 `core-js` 这个模块的 `postinstall` 这个过程, 以达到屏蔽广告的效果.\n\n将下面的代码添加到 `log.silly` 这行前面:\n```\nif(/^core-js(?:-(builder|bundle|compat|pure))?@/.test(packageId(pkg))){next();return;}\n```\n修改后的代码大致如下:\n\n![patched](./preview/patched.png \"patched\")\n\n## 预览\n\n### 打补丁前\n\n![before](./preview/before.png \"before\")\n\n### 打补丁后\n\n![after](./preview/after.png \"after\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxqin%2Fblock-core-js-postinstall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxqin%2Fblock-core-js-postinstall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxqin%2Fblock-core-js-postinstall/lists"}