{"id":13817270,"url":"https://github.com/chinanf-boy/path-run","last_synced_at":"2025-10-15T18:54:46.278Z","repository":{"id":57320721,"uuid":"131581276","full_name":"chinanf-boy/path-run","owner":"chinanf-boy","description":"rewrite And change project Path require|from 更改项目文件-被其他文件导入的所在位置  ✅","archived":false,"fork":false,"pushed_at":"2018-08-23T08:08:07.000Z","size":2600,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T11:13:00.079Z","etag":null,"topics":["abs-path","change","cli","from","path","require"],"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/chinanf-boy.png","metadata":{"files":{"readme":"readme.en.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":"2018-04-30T10:09:46.000Z","updated_at":"2018-10-13T06:57:55.000Z","dependencies_parsed_at":"2022-08-25T21:00:56.022Z","dependency_job_id":null,"html_url":"https://github.com/chinanf-boy/path-run","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fpath-run","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fpath-run/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fpath-run/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fpath-run/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinanf-boy","download_url":"https://codeload.github.com/chinanf-boy/path-run/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246866100,"owners_count":20846496,"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":["abs-path","change","cli","from","path","require"],"created_at":"2024-08-04T06:00:38.853Z","updated_at":"2025-10-15T18:54:46.151Z","avatar_url":"https://github.com/chinanf-boy.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\n# path-run[![Build Status](https://travis-ci.org/chinanf-boy/Path-run.svg?branch=master)](https://travis-ci.org/chinanf-boy/Path-run) [![codecov](https://codecov.io/gh/chinanf-boy/Path-run/badge.svg?branch=master)](https://codecov.io/gh/chinanf-boy/Path-run?branch=master) [![explain](http://llever.com/explain.svg)](https://github.com/chinanf-boy/path-run-explain)\n\n\u003e Esay change you require paths now\n\n[Chinese](./readme.md)\\|[English](./readme.en.md)\n\nIf you change the location of a file, then the corresponding file modification of other files is a problem.\n\nYou can try`path-run`, change your file location is not so manual\n\n## Install\n\n\tnpm install --global path-run\n\n\n## Correct use of -cli\n\n1.  Copy files to destination\n\n\n    - demo\n    \t- index.js\n    \t- input\n    \t\t- input1.js\n    \t\t- input2.js\n    \t- output\n    \t\t- output1.js\n    \t\t- output2.js\n\n    - demo\n    \t- index.js\n    \t- input\n    \t\t- ✂️input1.js // \u003c===== copy to output\n    \t\t- input2.js\n    \t- output\n    \t\t- ➕output3.js // \u003c===== from input/input1.js\n    \t\t- output1.js\n    \t\t- output2.js\n\n2.  Running`Cli`\n\n```bash\npath-run demo/input/input1.js demo/output/output3.js\n# path-run [input] [output]\n```\n\n1⃣️`Process.cwd()`All references below`Input`The path will become`Output`\n2⃣️ `Output` file , inside `require/import` file path change right relative path\n\n3.  Remove`Input1.js`\n\n\n    - demo\n    \t- index.js\n    \t- input\n    \t\t\t\t\t\u003c===== ✂️cut\n    \t\t- input2.js\n    \t- output\n    \t\t- output3.js // \u003c===== from input/input1.js\n    \t\t- output1.js\n    \t\t- output2.js\n\n[real-project transltemds](https://github.com/chinanf-boy/translate-mds/commit/af88620139276479a86185c731f4862ec54a54e4)\n\ncli demo\n\n![demo-cli-show](./demo-show/demo.gif)\n\ninpath with outpath diff\n\n![inpath-diff-outpath](./demo-show/diff.png)\n\nother require file diff\n\n![index-diff](./demo-show/index-diff.png)\n\n* * *\n\n## Warnning⚠️ , `path-run` do not change `package.json` main or bin string, pleace rechange yourself\n\n\n---\n\n## Api\n\n### Pathrun({options})\n\n#### Options\n\n##### 1. InPath\n\nType:`String`\n\nAbs path\n\n##### 2. OutPath\n\nType:`String`\n\nAbs path\n\n##### 3. cwd\n\nType:`String`\n\nDefault :`Process.cwd()`\n\n##### return\n\nType: `Array`\n\n`Array[i]` like this\n\n``` js\nconst options = {\n  files: 'path/to/file',\n  from: /foo/g,\n  to: 'bar',\n};\n```\n\nby `replace-in-file` use\n\nhttps://github.com/adamreisnz/replace-in-file\n\n## Cli\n\n    npm install --global path-run\n\n      esay change you require paths Now\n\n      Usage\n        $ path-run [input] [output]\n\n      Options\n            input  「want to change」\n            output  [turn on ]\n\n      Examples\n            $ path-run './index' './lib/index'\n\n      will change all process.cwd()/* files require Path 'index' =\u003e './lib/index'\n\n## concat\n\n[nodepaths](https://github.com/chinanf-boy/NodePath) js module map\n\n## License\n\nMit ©[Chinanf-boy](http://llever.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fpath-run","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinanf-boy%2Fpath-run","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fpath-run/lists"}