{"id":20699734,"url":"https://github.com/yuri2peter/npm-exec-shell","last_synced_at":"2026-04-21T00:02:55.035Z","repository":{"id":61271591,"uuid":"548669554","full_name":"yuri2peter/npm-exec-shell","owner":"yuri2peter","description":"nodejs执行sh脚本","archived":false,"fork":false,"pushed_at":"2022-11-07T05:55:30.000Z","size":389,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T21:39:32.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/yuri2peter.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}},"created_at":"2022-10-10T02:05:21.000Z","updated_at":"2024-11-20T08:48:23.000Z","dependencies_parsed_at":"2022-10-14T01:53:05.725Z","dependency_job_id":null,"html_url":"https://github.com/yuri2peter/npm-exec-shell","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yuri2peter/npm-exec-shell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuri2peter%2Fnpm-exec-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuri2peter%2Fnpm-exec-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuri2peter%2Fnpm-exec-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuri2peter%2Fnpm-exec-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuri2peter","download_url":"https://codeload.github.com/yuri2peter/npm-exec-shell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuri2peter%2Fnpm-exec-shell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27681788,"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","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"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":[],"created_at":"2024-11-17T00:31:42.193Z","updated_at":"2025-12-12T11:19:40.788Z","avatar_url":"https://github.com/yuri2peter.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @yuri2/exec-shell\n\n[Github](https://github.com/yuri2peter/npm-exec-shell)\n@yuri2/exec-shell 是 nodejs 调用 shell 脚本的一个方法库。\n\n## 安装\n\n`npm i @yuri2/exec-shell`\n\n## 使用\n\n```ts\nimport { execShellScriptContent } from \"@yuri2/exec-shell\";\n\nasync function main() {\n  const results1 = await execShellScriptContent(`echo hello`);\n  console.log(results1);\n\n  const results2 = await execShellScriptFile(__dirname + \"/test.sh\");\n  console.log(results2);\n}\n\nmain();\n```\n\n## 开发\n\n### 源码编写\n\n- `src` 目录下编写源码\n- `test` 目录下编写测试\n- `npm run test` 执行测试文件 `test/index.ts`\n\n### 打包编译\n\n```\n按需求，修改rollup.config.js文件\nnpm run build 生成index.ts文件和.d.ts声明文件\n```\n\n### 发布前测试\n\n1. 全局测试：把包链接到全局环境\n   ` npm link`\n\n2. 本地项目测试：把包链接到项目本地环境\n   `cd 本地项目根目录`\n   `npm link 包名`\n\n3. 取消本地项目测试：把包从本地环境取消\n   `cd 本地项目根目录`\n   `npm unlink 包名`\n\n4. 取消全局测试：把包从全局环境中取消\n   `npm unlink 包名`\n\n### npm 发布\n\n第一次发布：\n\n- 修改版本号\n- 提交 github\n  `npm publish --access public`\n\n更新版本：\n`npm run release`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuri2peter%2Fnpm-exec-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuri2peter%2Fnpm-exec-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuri2peter%2Fnpm-exec-shell/lists"}