1.5.1 • Published 6 years ago

mycli v1.5.1

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

Nodejs CLI TOOLS

Build Status Coverage Status NPM Version NPM Downloads

watch & copy command:

fs-extra, async to create a simple file and directory monitor & synchronize tool.

mycli watch-cp <source> <destination>

SimpleHTTPServer(like python one)

serve-static, express to provide static resouce http server, we create add extions feature. Please fellow below guide to provide extions js file.

mycli http-server <path> <port> [--https=true] [-e extionsService.js]

Extions definition:
TypeDescription
proxy1.3.0 new feature, integrate http-proxy-middleware
gethandle GET request in extion for special api or mock api
posthandle POST request in extion for special api or mock api

Extions e.g:
   // For proxy api extion:
	var ext = {
	    "/crservices":{
	        proxyURL:'http://staging.cross-v.me',
	        changeOrigin: true,
	        type:"proxy"
	    }
	};
	
	module.exports = ext;
   // For GET request extion:
	var ext = {
  		"/test/:name":{
    		fn:function(request, response){
      			response.send(request.params.name+' Hello World!');
    		},
    		type:"get"
  		}
	};

	module.exports = ext;

HTTP Proxy

js-yaml, nedb using yaml to provide proxy configuration and using nedb to record all response data.

mycli http-proxy <configuration file path>

We can through "http://127.0.0.1:[8888]/proxyDB" to manage proxy cache data.

please follow below structure to provide your yaml file:

server: port: 8888 proxyType: "HTTP" # if want to proxy HTTPS please change to HTTPS replay: false # if want to reuse local store response, change to true target: host: "query.yahooapis.com" port: 80 #key: "./privateKey.pem" # follow nodejs api doc to provide key for HTTPS #cert: "./certificate.pem" # follow nodejs api doc to provide cert for HTTPS #passphrase: "password" # a string of passphrase for the private key

Release description

1.4.1 - bug fix, (1)resolve http-proxy target server disconnect the proccess crash issue. (2)fixed recording error status response issue. (3) fixed PUT, DELETE issue.

1.4.0 - add proxy API whitelist feature

1.3.1 - minor bug fix

1.3.0 - add proxy extions in http-server

1.2.1 - add proxy datatbase manage page - http://127.0.0.1:[port]/proxyDB

1.5.1

6 years ago

1.5.0

6 years ago

1.4.2

6 years ago

1.4.1

7 years ago

1.4.0

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

9 years ago

1.2.1

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

0.0.2

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago