{"id":15292012,"url":"https://github.com/thwillert/autoinstall-npm","last_synced_at":"2026-05-15T18:32:14.299Z","repository":{"id":256020949,"uuid":"854130844","full_name":"THWillert/autoinstall-npm","owner":"THWillert","description":"A Node.js script that analyzes JavaScript or MJS files in a directory or specified file, checks for missing npm packages, and optionally installs them, while allowing user confirmation for each installation.","archived":false,"fork":false,"pushed_at":"2024-09-08T16:25:27.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T15:12:33.610Z","etag":null,"topics":["analyzer","automatic","checker","installer","npm","package","script"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/THWillert.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":"2024-09-08T13:17:15.000Z","updated_at":"2024-09-08T16:24:51.000Z","dependencies_parsed_at":"2024-09-08T15:20:34.596Z","dependency_job_id":"27d03aa5-7f59-46de-891c-0b5ec602570e","html_url":"https://github.com/THWillert/autoinstall-npm","commit_stats":null,"previous_names":["thwillert/autoinstall-npm"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THWillert%2Fautoinstall-npm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THWillert%2Fautoinstall-npm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THWillert%2Fautoinstall-npm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THWillert%2Fautoinstall-npm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/THWillert","download_url":"https://codeload.github.com/THWillert/autoinstall-npm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245247430,"owners_count":20584349,"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":["analyzer","automatic","checker","installer","npm","package","script"],"created_at":"2024-09-30T16:16:10.193Z","updated_at":"2025-10-17T00:15:03.564Z","avatar_url":"https://github.com/THWillert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# autoinstall-npm\n\n## Description\n\nThis Node.js script analyzes JavaScript (.js) or ECMAScript modules (.mjs) files to identify missing npm packages, installs them if necessary, and optionally prompts the user for confirmation before each installation. The script can process either a single file or all files in a specified directory.\n\n### Usage\n\n```bash\nnode script.js [-f \u003cfile\u003e | -d \u003cdirectory\u003e] [--confirm]\n```\n\n### Parameters\n- **`-f \u003cfile\u003e`**:\n  - **Description**: Specifies the path to a single Node.js file to analyze.\n  - **Note**: If this parameter is provided, the -d parameter is ignored.\n\n- **`-d \u003cdirectory\u003e`**:\n  - **Description**: Specifies the path to a directory. All .js and .mjs files in this directory will be analyzed.\n\n- **`--confirm`**:\n  - **Description**: Optional flag that prompts the user for confirmation before installing each missing package.\n \n## Examples\n1. Analyze and install missing packages for a single file with user confirmation:\n```bash\nnode script.js -f path/to/your/file.js --confirm\n```\n2. Process all .js and .mjs files in a directory and install missing packages without user confirmation:\n```bash\nnode script.js -d path/to/your/directory\n```\n3. Process all .js and .mjs files in a directory and prompt for confirmation before installation:\n```bash\nnode script.js -d path/to/your/directory --confirm\n```\n\n### Output\n- **Summary Table**: Displays a table of required packages for each file.\n- **Installation Prompts**: If --confirm is used, prompts for confirmation before installing each package.\n- **Status Messages**: Shows progress and status of the installation process with colored console output.\n\n ___\n\n## Author\n2025 Thorsten Willert\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthwillert%2Fautoinstall-npm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthwillert%2Fautoinstall-npm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthwillert%2Fautoinstall-npm/lists"}