{"id":15042471,"url":"https://github.com/ksxnodeapps/generate-npm-install","last_synced_at":"2026-01-06T17:10:12.101Z","repository":{"id":40699018,"uuid":"93948063","full_name":"ksxnodeapps/generate-npm-install","owner":"ksxnodeapps","description":"Generate npm install commands base on package.json","archived":false,"fork":false,"pushed_at":"2022-06-26T07:45:30.000Z","size":153,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T15:41:39.478Z","etag":null,"topics":["bash","bash-script","cli","command-line","generate","javascript","nodejs","npm","shell","shell-script","unix-command","unix-shell"],"latest_commit_sha":null,"homepage":"https://goo.gl/yncmzG","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/ksxnodeapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-10T15:26:55.000Z","updated_at":"2023-02-14T20:14:40.000Z","dependencies_parsed_at":"2022-08-18T23:51:37.218Z","dependency_job_id":null,"html_url":"https://github.com/ksxnodeapps/generate-npm-install","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksxnodeapps%2Fgenerate-npm-install","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksxnodeapps%2Fgenerate-npm-install/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksxnodeapps%2Fgenerate-npm-install/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksxnodeapps%2Fgenerate-npm-install/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksxnodeapps","download_url":"https://codeload.github.com/ksxnodeapps/generate-npm-install/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245831548,"owners_count":20679699,"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":["bash","bash-script","cli","command-line","generate","javascript","nodejs","npm","shell","shell-script","unix-command","unix-shell"],"created_at":"2024-09-24T20:47:21.653Z","updated_at":"2026-01-06T17:10:12.056Z","avatar_url":"https://github.com/ksxnodeapps.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# generate-npm-install\n\nGenerate npm/yarn install commands base on package.json\n\n## Requirements\n\n* Node.js ≥ 6.0.0, and npm\n* UNIX-like shell, e.g. sh, bash, zsh\n\n## Installation\n\n```bash\nnpm install --global generate-npm-install\n```\n\n## Usage\n\n### Command-line\n\nThis will generate `npm install --save-{prod,bundle,optional,dev}` or `yarn add {,--optional,--dev}` commands base on `package.json` in working directory\n\n```sh\ngenerate-npm-install # output contains: npm install --save... package1 package2 ...\nNPM_TAG=latest generate-npm-install # output contains: npm install --save... package1@latest package2@latest ...\nUSE_YARN=true generate-npm-install # output contains: yarn add ...\n```\n\nThis will generate `npm install` commands for `/path/to/directory/package.json`\n\n```sh\ngenerate-npm-install /path/to/directory\nNPM_TAG=latest generate-npm-install /path/to/directory\n```\n\nThis will execute generated `npm install` commands\n\n```sh\ngenerate-npm-install | sh\nNPM_TAG=latest generate-npm-install | sh\ngenerate-npm-install /path/to/directory | sh\nNPM_TAG=latest generate-npm-install /path/to/directory | sh\n```\n\n### JavaScript APIs\n\n#### Import module\n\n```javascript\nconst generateNpmInstall = require('generate-npm-install')\n```\n\n#### Function Usage\n\n```typescript\ngenerateNpmInstall(options: {\n  process: {\n    env: {\n      TAG?: string,\n      NPM_TAG: string = TAG,\n      USE_YARN: string = 'false'\n    }\n  } = require('process'),\n\n  fs: {\n    readFileSync: (filename: string) =\u003e {\n      toString: (encoding: string = 'utf8') =\u003e string\n    }\n  } = require('fs'),\n\n  path: {\n    resolve: (...args: string[]) =\u003e string\n  } = require('path'),\n\n  directory: string = process.cwd()\n}): string\n```\n\n* `options.process`: object, default to `process`\n* `options.process.env`: object, default to `{}`\n* `options.process.env.NPM_TAG`: string, default to `options.process.env.TAG`\n* `options.process.env.TAG`: string, default to `undefined`\n* `options.process.env.USE_YARN`: string, default to `'false'`\n* `options.fs`: object, default to `fs`\n* `options.fs.readFileSync`: function\n* `options.path`: object, default to `path`\n* `options.path.resolve`: function\n* `options.directory`: string, path to a directory, default to `options.process.cwd()`\n* Returns a string contains UNIX shell script\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksxnodeapps%2Fgenerate-npm-install","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksxnodeapps%2Fgenerate-npm-install","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksxnodeapps%2Fgenerate-npm-install/lists"}