@@ -12,24 +12,24 @@ npm install browserstack-local
1212
1313## Example
1414
15- ```
15+ ``` node
1616var browserstack = require (' browserstack-local' );
1717
18- # creates an instance of Local
18+ // creates an instance of Local
1919var bs_local = new browserstack.Local ();
2020
21- # replace <browserstack-accesskey> with your key. You can also set an environment variable - "BROWSERSTACK_ACCESS_KEY".
21+ // replace <browserstack-accesskey> with your key. You can also set an environment variable - "BROWSERSTACK_ACCESS_KEY".
2222var bs_local_args = { ' key' : ' <browserstack-accesskey>' };
2323
24- # starts the Local instance with the required arguments
24+ // starts the Local instance with the required arguments
2525bs_local .start (bs_local_args, function () {
2626 console .log (" Started BrowserStackLocal" );
2727});
2828
29- # check if BrowserStack local instance is running
29+ // check if BrowserStack local instance is running
3030console .log (bs_local .isRunning ());
3131
32- # stop the Local instance
32+ // stop the Local instance
3333bs_local .stop (function () {
3434 console .log (" Stopped BrowserStackLocal" );
3535});
@@ -42,31 +42,31 @@ Apart from the key, all other BrowserStack Local modifiers are optional. For the
4242
4343#### Verbose Logging
4444To enable verbose logging -
45- ```
45+ ``` node
4646bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' v' : ' true' }
4747```
4848
4949#### Folder Testing
5050To test local folder rather internal server, provide path to folder as value of this option -
51- ```
51+ ``` node
5252bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' f' : ' /my/awesome/folder' }
5353```
5454
5555#### Force Start
5656To kill other running Browserstack Local instances -
57- ```
57+ ``` node
5858bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' force' : ' true' }
5959```
6060
6161#### Only Automate
6262To disable local testing for Live and Screenshots, and enable only Automate -
63- ```
63+ ``` node
6464bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' onlyAutomate' : ' true' }
6565```
6666
6767#### Force Local
6868To route all traffic via local(your) machine -
69- ```
69+ ``` node
7070bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' forcelocal' : ' true' }
7171```
7272
@@ -78,13 +78,13 @@ To use a proxy for local testing -
7878* proxyUser: Username for connecting to proxy (Basic Auth Only)
7979* proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
8080
81- ```
81+ ``` node
8282bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' proxyHost' : ' 127.0.0.1' , ' proxyPort' : ' 8000' , ' proxyUser' : ' user' , ' proxyPass' : ' password' }
8383```
8484
8585#### Local Identifier
8686If doing simultaneous multiple local testing connections, set this uniquely for different processes -
87- ```
87+ ``` node
8888bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' localIdentifier' : ' randomstring' }
8989```
9090
@@ -94,14 +94,14 @@ bs_local_args = { 'key': '<browserstack-accesskey>', 'localIdentifier': 'randoms
9494
9595By default, BrowserStack local wrappers try downloading and executing the latest version of BrowserStack binary in ~ /.browserstack or the present working directory or the tmp folder by order. But you can override these by passing the -binarypath argument.
9696Path to specify local Binary path -
97- ```
97+ ``` node
9898bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' binarypath' : ' /browserstack/BrowserStackLocal' }
9999```
100100
101101#### Logfile
102102To save the logs to the file while running with the '-v' argument, you can specify the path of the file. By default the logs are saved in the local.log file in the present woring directory.
103103To specify the path to file where the logs will be saved -
104- ```
104+ ``` node
105105bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' v' : ' true' , ' logfile' : ' /browserstack/logs.txt' }
106106```
107107
0 commit comments