adb-driver
Advanced tools
Comparing version 0.0.7 to 0.1.0
{ | ||
"name": "adb-driver", | ||
"version": "0.0.7", | ||
"version": "0.1.0", | ||
"description": "A ADB(Android Debugging Bridge) command executor", | ||
"main": "index.js", | ||
"main": "build/AdbDriver.js", | ||
"license": "MIT", | ||
"author": "cangpeng<dustyface@163.com>", | ||
"scripts": { | ||
"start": "node index.js" | ||
"start": "tsc -w", | ||
"clean": "rimraf build", | ||
"format": "prettier \"{examples,lib,script,test}/**/*.{js,ts}\" \"*.yml\" --write", | ||
"test": "jest", | ||
"build": "npm run clean && tsc -p ./tsconfig.json" | ||
}, | ||
"author": "cangpeng<dustyface@163.com>" | ||
} | ||
"jest": { | ||
"testEnvironment": "node", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js" | ||
], | ||
"transform": { | ||
"^.+\\.tsx?$": "ts-jest" | ||
}, | ||
"testMatch": [ | ||
"**/?(*.)(spec|test).(ts|tsx|js)", | ||
"**/__tests__/*.(ts|tsx|js)", | ||
"**/test/*.(ts|tsx|js)" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "23.3.11", | ||
"@types/node": "10.12.18", | ||
"jest": "23.6.0", | ||
"prettier": "1.15.3", | ||
"rimraf": "2.6.3", | ||
"ts-jest": "23.10.5", | ||
"ts-node": "6.0.0", | ||
"typescript": "3.2.4" | ||
}, | ||
"gitHead": "b3cec16873e6c67289cf618ac195eb73bfb03385" | ||
} |
# adb-driver | ||
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest) | ||
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) | ||
## usage | ||
@@ -9,13 +12,11 @@ | ||
const adbDriver = require('adb-driver') | ||
const { exec } = adbDriver | ||
const { execADBCommand } = adbDriver | ||
exec(`adb devices`) | ||
.then((result) => { | ||
if (result instanceof Error) { | ||
console.error(`fail to execute adb devices`) | ||
return | ||
} | ||
console.info(`you can parse your devices info here: ${result}`) | ||
}) | ||
execADBCommand(`adb devices`).then(result => { | ||
if (result instanceof Error) { | ||
console.error(`fail to execute adb devices`) | ||
return | ||
} | ||
console.info(`you can parse your devices info here: ${result}`) | ||
}) | ||
``` | ||
@@ -27,6 +28,6 @@ | ||
const adbDriver = require('adb-driver') | ||
const { exec } = adbDriver | ||
const { execADBCommand } = adbDriver | ||
async function getDevices (callback) { | ||
const result = await exec(`adb devices`) | ||
async function getDevices(callback) { | ||
const result = await execADBCommand(`adb devices`) | ||
if (result instanceof Error) { | ||
@@ -40,2 +41,1 @@ console.error(`fail to execute adb devices`) | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
7234213
11
0
74
4
8