Support libs used across appium packages.
Installations
npm install appium-support
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
14.18.3
NPM Version
6.14.15
Score
60.4
Supply Chain
86.1
Quality
76.5
Maintenance
100
Vulnerability
93.7
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
appium
Download Statistics
Total Downloads
38,469,923
Last Day
7,173
Last Week
49,821
Last Month
219,884
Last Year
3,249,668
GitHub Statistics
17 Stars
455 Commits
30 Forks
18 Watching
4 Branches
32 Contributors
Package Meta Information
Latest Version
2.55.0
Package Id
appium-support@2.55.0
Unpacked Size
437.15 kB
Size
144.75 kB
File Count
37
NPM Version
6.14.15
Node Version
14.18.3
Total Downloads
Cumulative downloads
Total Downloads
38,469,923
Last day
-15.2%
7,173
Compared to previous day
Last week
-2.1%
49,821
Compared to previous week
Last month
-13.6%
219,884
Compared to previous month
Last year
-64.2%
3,249,668
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
32
appium-support
Utility functions used to support libs used across appium packages.
npm install appium-support
Appium, as of version 1.5 is all based on promises, so this module provides promise wrappers for some common operations.
Most notably, we wrap fs
for file system commands. Note the addition of hasAccess
.
Also note that fs.mkdir
doesn't throw an error if the directory already exists, it will just resolve.
Methods
-
system.isWindows
-
system.isMac
-
system.isLinux
-
system.isOSWin64
-
system.arch
-
system.macOsxVersion
-
util.hasContent - returns true if input string has content
-
util.hasValue - returns true if input value is not undefined and no null
-
util.escapeSpace
-
util.escapeSpecialChars
-
util.localIp
-
util.cancellableDelay
-
util.multiResolve - multiple path.resolve
-
util.unwrapElement - parse an element ID from an element object: e.g.:
{ELEMENT: 123, "element-6066-11e4-a52e-4f735466cecf": 123}
returns123
-
util.wrapElement - convert an element ID to an element object of the form: e.g.:
123
returns{ELEMENT: 123, "element-6066-11e4-a52e-4f735466cecf": 123}
-
fs.hasAccess - use this over
fs.access
-
fs.exists - calls
fs.hasAccess
-
fs.rimraf
-
fs.mkdir - doesn't throw an error if directory already exists
-
fs.copyFile
-
fs.open
-
fs.close
-
fs.access
-
fs.readFile
-
fs.writeFile
-
fs.write
-
fs.readlink
-
fs.chmod
-
fs.unlink
-
fs.readdir
-
fs.stat
-
fs.rename
-
fs.md5
-
plist.parsePlistFile
-
plist.updatePlistFile
-
mkdirp
-
logger
-
zip.extractAllTo - Extracts contents of a zipfile to a directory
-
zip.readEntries - Reads entries (files and directories) of a zipfile
-
zip.toInMemoryZip - Converts a directory into a base64 zipfile
logger
Basic logger defaulting to npmlog with special consideration for running
tests (doesn't output logs when run with _TESTING=1
in the env).
Logging levels
There are a number of levels, exposed as methods on the log object, at which logging can be made. The built-in ones correspond to those of npmlog, and are:
silly
, verbose
, info
, http
, warn
, and error
. In addition there is a debug
level.
The default threshold level is verbose
.
The logged output, by default, will be level prefix message
. So
1import { logger } from 'appium-support'; 2let log = logger.getLogger('mymodule'); 3log.warn('a warning');`
Will produce
1warn mymodule a warning
Environment variables
There are two environment variable flags that affect the way appium-base-driver
logger
works.
_TESTING
_TESTING=1
stops output of logs when set to1
.
_FORCE_LOGS
- This flag, when set to
1
, reverses the_TESTING
Usage
log.level
- get and set the threshold level at which to display the logs. Any logs at or above this level will be displayed. The special level silent will prevent anything from being displayed ever. See npmlog#level.
log[level](message)
- logs to
level
1import { logger } from 'appium-support'; 2let log = logger.getLogger('mymodule'); 3 4log.info('hi!'); 5// => info mymodule hi!
log.unwrap()
-
retrieves the underlying npmlog object, in order to manage how logging is done at a low level (e.g., changing output streams, retrieving an array of messages, adding log levels, etc.).
1import { getLogger } from 'appium-base-driver'; 2let log = getLogger('mymodule'); 3 4log.info('hi!'); 5 6let npmlogger = log.unwrap(); 7 8// any `npmlog` methods 9let logs = npmlogger.record; 10// logs === [ { id: 0, level: 'info', prefix: 'mymodule', message: 'hi!', messageRaw: [ 'hi!' ] }]
log.errorAndThrow(error)
-
logs the error passed in, at
error
level, and then throws the error. If the error passed in is not an instance of Error (either directly, or a subclass ofError
) it will be wrapped in a genericError
object.1import { getLogger } from 'appium-base-driver'; 2let log = getLogger('mymodule'); 3 4// previously there would be two lines 5log.error('This is an error'); 6throw new Error('This is an error'); 7 8// now is compacted 9log.errorAndThrow('This is an error');
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Warn: project license file does not contain an FSF or OSI license.
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/appium/.github/SECURITY.md:1
- Info: Found linked content: github.com/appium/.github/SECURITY.md:1
- Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy
- Info: Found text in security policy: github.com/appium/.github/SECURITY.md:1
Reason
Found 10/23 approved changesets -- score normalized to 4
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/node.js.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-support/node.js.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/appium/appium-support/node.js.yml/master?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 18 are checked with a SAST tool
Score
4.3
/10
Last Scanned on 2024-12-23
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 More