open-index/open-npm huggingface dataset:
npm package: @nayotta/mta-fetch
Description: fetch module
Author: nayotta.fe
Latest version: 1.2.1

# mta-fetch

[![Build & Lint & Test](https://github.com/nayotta/mta-fetch/actions/workflows/build.yml/badge.svg)](https://github.com/nayotta/mta-fetch/actions/workflows/build.yml)

> a simple browser fetch module.

## install

```sh
$ npm install @nayotta/mta-fetch --save
```

## example

```js
const MtaFetch = require('@nayotta/mta-fetch')

const mtaFetch = new MtaFetch({
	host: 'http://example.com',
	apis: {
		signin: {
			url: '/v1/signin',
			method: 'post',
			errMsgs: {
				200: 'signin success',
				401: 'unauthorization',
				500: 'sever error'
			}
		},
		getInfo: {
			url: '/v1/books/type/:id',
			method: 'get'
		}
	}
})

mtaFetch.send({
	type: 'signin',
	// default content-type is application/json
	// form-data can be set by format argument
	data: {
		username: 'username',
		password: 'password'
	}
}).then(res => {
	const { ok, status, errMsg, data } = res
	console.log(ok, status, errMsg, data)
})

mtaFetch.setToken('Bearer token')

mtaFetch.send({
	type: 'getInfo',
	urlParams: {
		id: 'info_id'
	},
	query: {
		search: 'keyword'
	},
	errMsg: {
		200: 'success',
		400: 'bad request',
		401: 'unauthorization',
		404: 'not found',
		500: 'server error'
	}
}).then(res => {
	const { ok, status, errMsg, data } = res
	console.log(ok, status, errMsg, data)
})
```
npm package: @nayotta/mta-fission-onion
Description: fission nodejs middleware module
Author: nayotta.fe
Latest version: 0.1.1

# mta-fission-onion

[![Build and Lint](https://github.com/nayotta/mta-fission-onion/actions/workflows/build.yml/badge.svg)](https://github.com/nayotta/mta-fission-onion/actions/workflows/build.yml)[![Node.js Package](https://github.com/nayotta/mta-fission-onion/actions/workflows/release.yml/badge.svg)](https://github.com/nayotta/mta-fission-onion/actions/workflows/release.yml)

[EN](./README.md)

> 在 [`fission/nodejs`](https://fission.io/docs/usage/languages/nodejs/) 内使用的，仿 [`koajs`](https://koajs.com/) 风格洋葱式中间件处理模块.

## 安装

```sh
$ npm install @nayotta/mta-fission-onion
```

## 使用

```js
// fission function js file
const { Onion } = require('@nayotta/mta-fission-onion')

const onion = new Onion()

onion.use(async (ctx, next) => {
	// TODO: 权限验证
	const authPass = true
	if (!authPass) {
		ctx.status = 401
		ctx.body = 'unauthrization'
		return
	}
	await next()
})

onion.use(async (ctx, next) => {
	// TODO: 处理数据
	// ctx.request即为fission/nodejs提供的express/request对象
	const data = 'hello' + ctx.request.body.name
	ctx.status = 200
	ctx.body = {
		data
	}
})

// 或者批量注入中间件函数
onion.inject([async (ctx, next) => {
	// do something
	await next()
}, () => {
	// do something
	await next()
}])

module.export = onion.go()
```
npm package: @nayotta/mta-wechat-mp
Description: wechat miniprogram resources sdk for javascript/typescript
Author: nayotta.fe
Latest version: 0.2.3

# mta-wechat-mp

[![Build & Lint & Test](https://github.com/nayotta/mta-wechat-mp/actions/workflows/build.yml/badge.svg)](https://github.com/nayotta/mta-wechat-mp/actions/workflows/build.yml)[![Node.js Package](https://github.com/nayotta/mta-wechat-mp/actions/workflows/release.yml/badge.svg)](https://github.com/nayotta/mta-wechat-mp/actions/workflows/release.yml)

[zh_CN](./README.md)

> an unofficial wechat miniprogram resources sdk for `javascript`/`typescript`

## install

```sh
$ npm install @nayotta/mta-wechat-mp
```

## How to use it ?

```typescript
import { MtaWechatMp } from '@nayotta/mta-wechat-mp'

const mtaWechatMp = new MtaWechatMp({
	appid: 'your_app_id',
	secret: 'your_app_secret',
	cloudEnvs: {
		develop: 'develop_cloud_env_id',
		production: 'production_cloud_env_id'
	},
	// warning: It is not recommended to operate on the client side, optional
	proxy: {
		proxyUrl: 'http://localhost:2333/mp'
	},
	// optional timezone setting
	tz: 'Asia/Shanghai'
})

// cloud
const {
	// database
	db： devDb,
	// cloud function
	func: devFunc,
	// cloud storage
	storage: devStorage
} = mtaWechatMp.clouds.develop

// analysis
mtaWechatMp.analysis.getVisitTrend({
	type: 'daily',
	beginDete: '2021-12-22',
	endDate: '2021-12-22'
}).then(res => {
	console.log(res)
}).catch(err => {
	console.error(err)
})
```

## TODO

- add documents (Github wiki);

- more unit tests;

- add others modules of MtaWechatMp, your PR is welcomed;
npm package: @naytev/draft-js-emoji-plugin
Description: Emoji Plugin for DraftJS
Author: Nik Graf
Latest version: 2.0.0-rc3

# DraftJS Emoji Plugin

*This is a plugin for the `draft-js-plugins-editor`.*

This plugin provides consistent Emoji display across all platforms, independent of the host system.

## Usage

```js
import createEmojiPlugin from 'draft-js-emoji-plugin';

const emojiPlugin = createEmojiPlugin();
```
## Advanced Usage

```js
const emojiPlugin = createEmojiPlugin({
  priorityList: {
    ':see_no_evil:': ["1f648"],
    ':raised_hands:': ["1f64c"],
    ':100:': ["1f4af"],
  }
});
// emojis in priorityList will show up after user typed ':'
```
## Importing the default styles

The plugin ships with a default styling available at this location in the installed package:
`node_modules/draft-js-emoji-plugin/lib/plugin.css`.

### Webpack Usage

Follow the below steps to import the css file by using Webpack's `style-loader` and `css-loader`. 

1. Install Webpack loaders: `npm install style-loader css-loader --save-dev`
2. Add the below section to Webpack config (if your Webpack already has loaders array, simply add the below loader object(`{test:foo, loaders:bar[]}`) as an item in the array).

    ```js
    module: {
      loaders: [{
        test: /\.css$/,
        loaders: [
          'style', 'css'
        ]
      }]
    }
    ```

3. Add the below import line to your component to tell Webpack to inject style to your component.

    ```js
    import 'draft-js-emoji-plugin/lib/plugin.css';
    ```
4. Restart Webpack.


### Browserify Usage

TODO: PR welcome
npm package: @naytev/draft-js-mention-plugin
Description: Mention Plugin for DraftJS
Author: Nik Graf
Latest version: 2.0.0-beta11

# DraftJS Mention Plugin

*This is a plugin for the `draft-js-plugins-editor`.*

This plugin allows you to add mentions to your editor!

Usage:

```js
import createMentionPlugin from 'draft-js-mention-plugin';

const mentionPlugin = createMentionPlugin({ mentions });
```

## Importing the default styles

The plugin ships with a default styling available at this location in the installed package:
`node_modules/draft-js-mention-plugin/lib/plugin.css`.

### Webpack Usage
Follow the steps below to import the css file by using Webpack's `style-loader` and `css-loader`.

1. Install Webpack loaders: `npm install style-loader css-loader --save-dev`
2. Add the below section to Webpack config (if your Webpack already has loaders array, simply add the below loader object(`{test:foo, loaders:bar[]}`) as an item in the array).

    ```js
    module: {
      loaders: [{
        test: /\.css$/,
        loaders: [
          'style', 'css'
        ]
      }]
    }
    ```

3. Add the below import line to your component to tell Webpack to inject style to your component.

    ```js
    import 'draft-js-mention-plugin/lib/plugin.css';
    ```
4. Restart Webpack.

### Browserify Usage

TODO: PR welcome