# xext

> A helper module writen in typescript for build xuanxuan extension.

Latest version **0.1.4** (published 2019-06-13) · MIT license · 0 weekly downloads

## Install

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

## 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.1.4 |
| Published | 2019-06-13 |
| First published | 2019-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 156.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Catouse |
| Maintainers | catouse |

## Links

- npm: https://www.npmjs.com/package/xext
- Repository: https://github.com/catouse/xext
- Homepage: https://github.com/catouse/xext#readme
- Issues: https://github.com/catouse/xext/issues
- npm.io page: https://npm.io/package/xext

## Dependencies (3)

- [@types/node](https://npm.io/package/@types/node.md) ^10.12.18
- [@types/react](https://npm.io/package/@types/react.md) ^16.7.20
- [@types/react-dom](https://npm.io/package/@types/react-dom.md) ^16.0.11

## Recent versions

- 0.1.4 (latest) — 2019-06-13
- 0.1.3 — 2019-05-25
- 0.1.2 — 2019-01-20
- 0.1.1 — 2019-01-20
- 0.1.0 — 2019-01-20

## README

# xext

喧喧扩展开发辅助模块，包含 TypeScript 定义。

## 使用方法

### 1. 安装模块

```shell
npm install xext --save
```

### 2. 导入 `xext` 模块

```ts
import xext, {
  DEBUG,
  lang,
  nodeModules,
  views,
  components,
  utils,
  platform,
  app
} from 'xext';
```

### 3. 使用示例

编写应用扩展 React 组件模块 `app.ts`：

```ts
import {React, ReactDOM} from 'xext';

export default (props: any) => {
    const {app} = props;
    return <div className="red box">Hello: {app.name}</div>
};
```

编写扩展模块：

```ts
import xext, {DEBUG} from 'xext';
import AppView from './app';

const extension: ExtensionModule = {
    onAttach(ext: Xuanxuan.Extension) {
        if (DEBUG) {
            console.log(`Extension '${ext.displayName}' loaded from ${ext.mainFile}.`);
        }
    },
    MainView: AppView
};

export default extension;
```

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