Installations
npm install browserstack-local
Score
83
Supply Chain
99.1
Quality
74.2
Maintenance
100
Vulnerability
98.1
License
Releases
Locked ps-tree version to 1.1.1
Published on 27 Nov 2018
Changed local binary paths to support LocalBinary 7.3. Fixed folder argument.
Published on 19 Oct 2018
Fixed issue with stopping local in docker.
Published on 24 Aug 2018
Updated Tunnel Flags to correspond to the new BrowserStackLocal binary spec
Published on 09 Jan 2017
Fixes binary download errors
Published on 25 Oct 2016
Support proxy for downloading binary
Published on 03 Aug 2016
Developer
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
Yes
Node Version
18.18.0
NPM Version
9.8.1
Statistics
71 Stars
220 Commits
56 Forks
20 Watching
18 Branches
53 Contributors
Updated on 17 Jun 2024
Bundle Size
32.46 kB
Minified
11.02 kB
Minified + Gzipped
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
67,143,750
Last day
-8.3%
60,944
Compared to previous day
Last week
2.6%
370,991
Compared to previous week
Last month
4.7%
1,475,265
Compared to previous month
Last year
0.1%
16,256,519
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
5
browserstack-local-nodejs
Nodejs bindings for BrowserStack Local.
Installation
npm install browserstack-local
Example
1var browserstack = require('browserstack-local'); 2 3//creates an instance of Local 4var bs_local = new browserstack.Local(); 5 6// replace <browserstack-accesskey> with your key. You can also set an environment variable - "BROWSERSTACK_ACCESS_KEY". 7var bs_local_args = { 'key': '<browserstack-accesskey>' }; 8 9// starts the Local instance with the required arguments 10bs_local.start(bs_local_args, function() { 11 console.log("Started BrowserStackLocal"); 12 13 // check if BrowserStack local instance is running 14 console.log(bs_local.isRunning()); 15 16 // stop the Local instance 17 bs_local.stop(function() { 18 console.log("Stopped BrowserStackLocal"); 19 }); 20}); 21
Arguments
Apart from the key, all other BrowserStack Local modifiers are optional. For the full list of modifiers, refer BrowserStack Local modifiers. For examples, refer below -
Verbose Logging
To enable verbose logging -
1bs_local_args = { 'key': '<browserstack-accesskey>', 'verbose': 'true' }
Note - Possible values for 'verbose' modifier are '1', '2', '3' and 'true'
Folder Testing
To test local folder rather internal server, provide path to folder as value of this option -
1bs_local_args = { 'key': '<browserstack-accesskey>', 'f': '/my/awesome/folder' }
Force Start
To kill other running Browserstack Local instances -
1bs_local_args = { 'key': '<browserstack-accesskey>', 'force': 'true' }
Only Automate
To disable local testing for Live and Screenshots, and enable only Automate -
1bs_local_args = { 'key': '<browserstack-accesskey>', 'onlyAutomate': 'true' }
Force Local
To route all traffic via local(your) machine -
1bs_local_args = { 'key': '<browserstack-accesskey>', 'forceLocal': 'true' }
Proxy
To use a proxy for local testing -
- proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
- proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used
- proxyUser: Username for connecting to proxy (Basic Auth Only)
- proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
- useCaCertificate: Path to ca cert file, if required
1bs_local_args = { 'key': '<browserstack-accesskey>', 'proxyHost': '127.0.0.1', 'proxyPort': '8000', 'proxyUser': 'user', 'proxyPass': 'password', 'useCaCertificate': '/Users/test/cert.pem' }
Local Proxy
To use local proxy in local testing -
- localProxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
- localProxyPort: Port for the proxy, defaults to 8081 when -localProxyHost is used
- localProxyUser: Username for connecting to proxy (Basic Auth Only)
- localProxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
bs_local_args = { 'key': '<browserstack-accesskey>', 'localProxyHost': '127.0.0.1', 'localProxyPort': '8000', 'localProxyUser': 'user', 'localProxyPass': 'password' }
PAC (Proxy Auto-Configuration)
To use PAC (Proxy Auto-Configuration) in local testing -
- pac-file: PAC (Proxy Auto-Configuration) file’s absolute path
bs_local_args = { 'key': '<browserstack-accesskey>', 'pac-file': '<pac_file_abs_path>' }
Local Identifier
If doing simultaneous multiple local testing connections, set this uniquely for different processes -
1bs_local_args = { 'key': '<browserstack-accesskey>', 'localIdentifier': 'randomstring' }
Additional Arguments
Binary Path
By 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. Path to specify local Binary path -
1bs_local_args = { 'key': '<browserstack-accesskey>', 'binarypath': '/browserstack/BrowserStackLocal' }
Logfile
To 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. To specify the path to file where the logs will be saved -
1bs_local_args = { 'key': '<browserstack-accesskey>', 'verbose': 'true', 'logFile': '/browserstack/logs.txt' }
Contribute
Instructions
To run the test suite run, npm test
.
Reporting bugs
You can submit bug reports either in the Github issue tracker.
Before submitting an issue please check if there is already an existing issue. If there is, please add any additional information give it a "+1" in the comments.
When submitting an issue please describe the issue clearly, including how to reproduce the bug, which situations it appears in, what you expect to happen, what actually happens, and what platform (operating system and version) you are using.
Pull Requests
We love pull requests! We are very happy to work with you to get your changes merged in, however, please keep the following in mind.
- Adhere to the coding conventions you see in the surrounding code.
- Include tests, and make sure all tests pass.
- Before submitting a pull-request, clean up the git history by going over your commits and squashing together minor changes and fixes into the corresponding commits. You can do this using the interactive rebase command.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
GitHub workflow tokens follow principle of least privilege
Details
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/Semgrep.yml:22
- Info: topLevel 'contents' permission set to 'read': .github/workflows/Semgrep.yml:16
- Info: no jobLevel write permissions found
Reason
no dangerous workflow patterns detected
Reason
all dependencies are pinned
Details
- Info: 2 out of 2 GitHub-owned GitHubAction dependencies pinned
Reason
license file detected
Details
- Info: project has a license file: MIT-LICENSE.txt:0
- Info: FSF or OSI recognized license: MIT License: MIT-LICENSE.txt:0
Reason
Found 10/13 approved changesets -- score normalized to 7
Reason
7 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
Reason
SAST tool is not run on all commits -- score normalized to 1
Details
- Warn: 3 commits out of 27 are checked with a SAST tool
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
5.6
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to browserstack-local
browserstack-local-promise
A promisified version of the browserstack-local proxy
posthog-js
Posthog-js allows you to automatically capture usage and send events to PostHog.
@wdio/browserstack-service
WebdriverIO service for better Browserstack integration
testcafe-browser-provider-browserstack
Browserstack TestCafe browser provider plugin.