0.1.0 • Published 6 years ago

path-run v0.1.0

Weekly downloads
9
License
MIT
Repository
github
Last release
6 years ago

path-runBuild Status codecov explain

Esay change you require paths now

Chinese|English

If you change the location of a file, then the corresponding file modification of other files is a problem.

You can trypath-run, change your file location is not so manual

Install

npm install --global path-run

Correct use of -cli

  1. Copy files to destination
- demo
	- index.js
	- input
		- input1.js
		- input2.js
	- output
		- output1.js
		- output2.js

- demo
	- index.js
	- input
		- ✂️input1.js // <===== copy to output
		- input2.js
	- output
		- ➕output3.js // <===== from input/input1.js
		- output1.js
		- output2.js
  1. RunningCli
path-run demo/input/input1.js demo/output/output3.js
# path-run [input] [output]

1⃣️Process.cwd()All references belowInputThe path will becomeOutput 2⃣️ Output file , inside require/import file path change right relative path

  1. RemoveInput1.js
- demo
	- index.js
	- input
					<===== ✂️cut
		- input2.js
	- output
		- output3.js // <===== from input/input1.js
		- output1.js
		- output2.js

real-project transltemds

cli demo

demo-cli-show

inpath with outpath diff

inpath-diff-outpath

other require file diff

index-diff


Warnning⚠️ , path-run do not change package.json main or bin string, pleace rechange yourself


Api

Pathrun({options})

Options

1. InPath

Type:String

Abs path

2. OutPath

Type:String

Abs path

3. cwd

Type:String

Default :Process.cwd()

return

Type: Array

Array[i] like this

const options = {
  files: 'path/to/file',
  from: /foo/g,
  to: 'bar',
};

by replace-in-file use

https://github.com/adamreisnz/replace-in-file

Cli

npm install --global path-run

  esay change you require paths Now

  Usage
    $ path-run [input] [output]

  Options
        input  「want to change」
        output  [turn on ]

  Examples
        $ path-run './index' './lib/index'

  will change all process.cwd()/* files require Path 'index' => './lib/index'

concat

nodepaths js module map

License

Mit ©Chinanf-boy

0.1.0

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago