Skip to content

Commit f0d8f7f

Browse files
author
no
committed
fix(wbenv): make it work
1 parent 3bb366c commit f0d8f7f

File tree

6 files changed

+1594
-2311
lines changed

6 files changed

+1594
-2311
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ NODE_OPTIONS="-r wirebird-client/inject" \
2828
node my-script.js
2929
```
3030

31+
Using `wbenv` command:
32+
33+
```sh
34+
wbenv ui node my-script.js
35+
```
36+
3137
Specify Wirebird host and port manually:
3238

3339
```sh
@@ -36,6 +42,12 @@ NODE_OPTIONS="-r wirebird-client/inject" \
3642
node my-script.js
3743
```
3844

45+
Using `wbenv` command:
46+
47+
```sh
48+
wbenv -h http://<wirebird-host>:<wirebird-port> ui node my-script.js
49+
```
50+
3951
### Without Wirebird
4052

4153
Log HTTP requests to the terminal:
@@ -46,6 +58,12 @@ NODE_OPTIONS="-r wirebird-client/inject" \
4658
node my-script.js
4759
```
4860

61+
Using `wbenv` command:
62+
63+
```sh
64+
wbenv pretty node my-script.js
65+
```
66+
4967
Log HTTP requests to the terminal as curl commands:
5068

5169
```sh
@@ -54,3 +72,30 @@ NODE_OPTIONS="-r wirebird-client/inject" \
5472
node my-script.js
5573
```
5674

75+
Using `wbenv` command:
76+
77+
```sh
78+
wbenv curl node my-script.js
79+
```
80+
81+
### Wbenv command reference
82+
83+
`wbenv` (**W**ire**b**ird **env**ironment) command is a shell wrapper
84+
that is included with `wirebird-client` package, allowing to run a Node.js script
85+
with `WIREBIRD` and `NODE_OPTIONS` variables set.
86+
87+
Syntax:
88+
89+
```sh
90+
wbenv [-h wirebird_host] {ui|curl|pretty} <command>
91+
```
92+
93+
Examples:
94+
95+
```sh
96+
wbenv ui npm start #runs `npm start` logging HTTP requests with Wirebird
97+
wbenv ui yarn add -D @types/react #runs `yarn add -D @types/react` logging HTTP requests with Wirebird (cool, eh?)
98+
wbenv -h http://192.168.88.1:4380 ui node app.js
99+
#runs `node app.js` logging HTTP requests with Wirebird running on http://192.168.88.1:4380
100+
wbenv curl zapier push #runs `zapier push` logging HTTP requests to terminal as Curl commands
101+
```

0 commit comments

Comments
 (0)