{"id":15357209,"url":"https://github.com/gera2ld/clean-run","last_synced_at":"2026-05-29T06:31:36.158Z","repository":{"id":57199758,"uuid":"370601238","full_name":"gera2ld/clean-run","owner":"gera2ld","description":"Run a Node.js script in a clean environment","archived":false,"fork":false,"pushed_at":"2021-05-27T06:29:54.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-15T05:52:54.496Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/gera2ld.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}},"created_at":"2021-05-25T07:19:41.000Z","updated_at":"2021-05-27T06:32:21.000Z","dependencies_parsed_at":"2022-09-16T15:02:07.001Z","dependency_job_id":null,"html_url":"https://github.com/gera2ld/clean-run","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fclean-run","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fclean-run/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fclean-run/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fclean-run/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gera2ld","download_url":"https://codeload.github.com/gera2ld/clean-run/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241913788,"owners_count":20041459,"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-01T12:34:00.977Z","updated_at":"2026-05-29T06:31:36.148Z","avatar_url":"https://github.com/gera2ld.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clean-run\n\n[![NPM](https://img.shields.io/npm/v/clean-run.svg)](https://npm.im/clean-run)\n![License](https://img.shields.io/npm/l/clean-run.svg)\n![Downloads](https://img.shields.io/npm/dt/clean-run.svg)\n\nRun a Node.js script in a clean environment without caring about the dependencies. This is a `deno run` alternative that works for Node.js.\n\nRequires Node.js \u003e= 14.14.0.\n\n## Motivation\n\nWhen running a CI script, it is likely that we don't need all dependencies defined in a `package.json`. It might take relatively long time and high bandwidth to install all of them, especially when there are Electron and its friends. In areas with low bandwidth or poor network connections this may be a bigger problem as installation may fail and we have to care about packages that we don't even need.\n\nIf you are familiar with Deno, you will miss the feature to run a script with all the dependencies from remote. With `clean-run` you can easily run a script like that in Node.js.\n\nIf you are tired of writing obscure Bash scripts, you can write a Node.js script and let `clean-run` to deal with the dependencies.\n\n## How does this work?\n\n`clean-run` scans the entry script file to see what packages it really depends on and only install those needed. We don't have to set mirrors and wait for large packages that are not even required.\n\n## Usage\n\n\n```\nUsage:\n\n$ clean-run [options] \u003centryFile\u003e [other arguments ...]\n\n  \u003centryFile\u003e   path to the main script, set to - if piped from stdin\n\nOptions:\n\n  -s            suppress npm logs\n```\n\nYou will need to install this one dependency first.\n\n```bash\n$ npm install clean-run\n$ clean-run my-script.js\n```\n\nOr you can use npx to get a one-liner:\n\n```bash\n$ npx clean-run -s my-script.js\n```\n\nYou can even run a remote script directly (try it by yourself 👇🏻):\n\n```bash\n$ curl -fsSL https://raw.githubusercontent.com/gera2ld/clean-run/master/demos/cowsay.js | npx clean-run -s -\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgera2ld%2Fclean-run","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgera2ld%2Fclean-run","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgera2ld%2Fclean-run/lists"}