# yyl-os

> os ctrl

Latest version **0.14.4** (published 2021-06-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install yyl-os
pnpm add yyl-os
yarn add yyl-os
bun add yyl-os
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.14.4 |
| Published | 2021-06-05 |
| First published | 2018-08-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 8.0.0 |
| Dependencies | 1 |
| Unpacked size | 250.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | jackness |
| Maintainers | jackness |

## Links

- npm: https://www.npmjs.com/package/yyl-os
- Repository: https://github.com/jackness1208/yyl-os
- Homepage: https://github.com/jackness1208/yyl-os#readme
- Issues: https://github.com/jackness1208/yyl-os/issues
- npm.io page: https://npm.io/package/yyl-os

## Dependencies (1)

- [yyl-util](https://npm.io/package/yyl-util.md) ^2.3.5

## Recent versions

- 0.14.4 (latest) — 2021-06-05
- 0.14.3 — 2021-05-22
- 0.14.2 — 2021-05-17
- 0.14.1 — 2021-05-16
- 0.14.0 — 2021-05-03
- 0.13.0 — 2021-05-03
- 0.12.0 — 2021-04-30
- 0.11.4 — 2020-12-25
- 0.11.3 — 2020-12-25
- 0.11.2 — 2020-07-08
- 0.11.1 — 2020-04-09
- 0.11.0 — 2020-04-09
- 0.10.3 — 2020-02-10
- 0.10.2 — 2019-09-25
- 0.10.0 — 2019-07-31
- … 17 more at https://npm.io/package/yyl-os/versions

## README

# yyl - os SDK 
```
const extOs = require('yyl-os');
```

## extOs.rm()
```
/**
 * @param  {String}          iPath 文件绝对路径
 * @return {Promise<string>} log   cmd log
 */
extOs.rm(iPath)
```

## extOs.openBrowser()
```
/**
 * @param  {String}          address 网页地址
 * @return {Promise<string>} log     cmd log
 */
extOs.openBrowser(address)
```

## extOs.runCMD()
```
/**
 * @param  {String}          str         cmd 命令
 * @param  {String}          path        执行命令的目录
 * @param  {Boolean}         showOutput  显示日志
 * @param  {Boolean}         newWindow   新窗口打开
 * @return {Promise<string>} log         cmd log
 */
extOs.runCMD(str, path, showOutput, newWindow)

/**
 * @param  {String}          str         cmd 命令
 * @param  {Object}          iEnv        环境变量设置
 * @param  {String}          path        执行命令的目录
 * @param  {Boolean}         showOutput  显示日志
 * @param  {Boolean}         newWindow   新窗口打开
 * @return {Promise<string>} log         cmd log
 */
extOs.runCMD(str, iEnv, path, showOutput, newWindow)
```

## extOs.runSpawn()
```
/**
 * @param  {String}          str         cmd 命令
 * @param  {String}          path        执行命令的目录
 * @param  {Boolean}         showOutput  是否显示输出
 * @return {Promise<string>} log         cmd log
 */
extOs.runSpawn(str, path, showOutput)

/**
 * @param  {String}          str         cmd 命令
 * @param  {Object}          iEnv        环境变量设置
 * @param  {String}          path        执行命令的目录
 * @param  {Boolean}         showOutput  是否显示输出
 * @return {Promise<string>} log         cmd log
 */
extOs.runSpawn(str, iEnv, path, showOutput)
```

## extOs.openPath()
```
/**
 * @param  {String}          address  文件路径
 * @return {Promise<string>} log      cmd log
 */
extOs.openPath(address)
```

## extOs.checkPort()
```
/**
 * 检查 端口是否可用
 * @param  {Number}           port    端口号
 * @return {Promise<boolean>} canUse  端口是否可用
 */
extOs.checkPort(port)
```

## extOs.IS_WINDOWS
```
// 是否属于 win 系统
extOs.IS_WINDOWS
```

## extOs.IS_WINDOWS_7
```
// 是否属于 win7 系统
extOs.IS_WINDOWS_7
```

## extOs.IS_LINUX
```
// 是否属于 linux 系统
extOs.IS_LINUX
```

## extOs.LOCAL_IP
```
// 本地ip 地址
extOs.LOCAL_IP
```
## extOs.clip(str)
```
/**
 * 复制 字符串到系统剪贴板(支持 windows 和 macos)
 * @param  {String}          str      需要复制的内容
 * @return {Promise<string>} log      cmd log
 */
extOs.clip(str)
```

## extOs.installNodeModules(plugins, basePath)
```
/**
 * 安装 node plugins
 * @param  {Array}        plugins  组件列表
 * @param  {String}       basePath 安装路径
 * @return {Promise<any>}
 */
 extOs.installNodeModules(plugins, basePath)
```
## extOs.getChromeVersion()
```
/**
 * 获取 chrome 版本
 * @return Promise<any>
 */
 extOs.getChromeVersion()
```
## extOs.getJavaVersion()
```
/**
 * 获取 java 版本
 * @return Promise<any>
 */
 extOs.getJavaVersion()
```

---
_Source: https://npm.io/package/yyl-os · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
