# jyb_jfet

> jyb front-end tookit.

Latest version **1.3.4** (published 2019-07-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install jyb_jfet
pnpm add jyb_jfet
yarn add jyb_jfet
bun add jyb_jfet
```

Provides the command `jfet`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.4 |
| Published | 2019-07-18 |
| First published | 2019-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 18.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | mocept |
| Maintainers | mocept |
| Keywords | front-end, tookit |

## Links

- npm: https://www.npmjs.com/package/jyb_jfet
- npm.io page: https://npm.io/package/jyb_jfet

## Dependencies (6)

- [ora](https://npm.io/package/ora.md) ^1.3.0
- [chalk](https://npm.io/package/chalk.md) ^2.0.1
- [yargs](https://npm.io/package/yargs.md) ^8.0.2
- [figlet](https://npm.io/package/figlet.md) ^1.2.0
- [urllib](https://npm.io/package/urllib.md) ^2.24.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^3.0.1

## Recent versions

- 1.3.4 (latest) — 2019-07-18

## README

# jfet

前端开发工具

## 安装

```shell
npm i jyb_jfet -g
```

## 使用

```shell
jfet -u/--update // 更新插件和解决方案
jfet -v/--version // 显示版本
jfet -h/--help // 显示帮助
```

## 配置

### jfet.config.js

工具总配置，会获取和当前执行的命令同名的函数执行

```javascript
module.exports = {
  build(abc, context) {
    // 假如插件名为build，abc应该为abc.json文件中的build字段的值
    // context为configFunc.setParameter设置的值，context可以看对应的命令插件的文档
  },
  server(abc, context) {},
  pack(abc, context) {}
}
```

### abc.json

子配置，执行命令的时候会读取，并且把跟当前命令同名的字段的值，作为jfet.config.js配置中同名的函数的第一个参数注入，一般用于一个项目有多个子项目的情况，利用这个特性，可以封装为解决方案

```javascript
{
  "jfetOptions": { // 跟package.json中的jfetOptions字段一致
    "commandPlugin": "./index.js",
    "configFilePath": "../../"
  },
  "build": {}, // 可以在jfet.config.js中的build函数第一个参数获取到
  "server": {},
  "pack": {}
}
```

### package.json

如果当前目录下的`package.json`中有`jfetOptions`字段，会优先使用`jfetOptions`中的设置，不过`abc.json`中的`jfetOptions`优先级要高。

`jfetOptions`有两个字段：

- `commandPlugin`，优先查找`jfetOptions.commandPlugin`作为插件入口
- `configFilePath`，优先查找`jfetOptions.configFilePath`作为配置文件路径

```javascript
"jfetOptions": {
  "commandPlugin": "./lib/index.js",
  "configFilePath": "demo"
}
```

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