open-index/open-npm huggingface dataset:
npm package: @mest-fe/brands
Description: [Mest Brands](https://brands.mest.io) Resources
Latest version: 0.0.1

# `@mest-fe/brands`

[Mest Brands](https://brands.mest.io) Resources



## Usage

### Use JSDeliver CDN



### Use NPM Package


```shell
yarn add @mest-fe/brands
```


```typescript jsx
import {
  LogoCardHorizontalDark,
  LogoCardHorizontalLight,
  LogoHorizontalDark,
  LogoHorizontalLight,
  LogoVerticalDark,
  LogoVerticalLight,
} from '@mest-fe/brands'


export const YourPage = () => (
  <div>
    <LogoCardHorizontalDark />
  </div>
)
```
npm package: @mest-fe/porters-middleware
Description: 供 [Porters](https://github.com/mest-io/porters) 项目使用的 Lambda 中间件，适用于 [Nitric](https://nitric.io/docs/installation) 环境。
Author: MEST
Latest version: 0.4.0

## Porters Middleware

供 [Porters](https://github.com/mest-io/porters) 项目使用的 Lambda 中间件，适用于 [Nitric](https://nitric.io/docs/installation) 环境。

### 介绍

#### Schedule Middleware

标准化外部调用参数，将定时任务平台或手动调用提供的参数序列化后提供给 Lambda。在调用时，单个 Lambda 可能同时被并行调用多次，
每个函数内部请按当前序列号来决定需要处理的任务批次。

函数参数来自于 `request body`，序列化后可参考：

- `version`: 当前调用版本，hash 字符串
- `current`: 当前 Lambda 工作的位置，相对于并发数的序列号，从 1 开始，应当小于 `concurrency`
- `concurrency`: 当前调用版本的并发数
- `ignoreRetry`: 是否忽略重试

#### Auth Middleware

使用后 Lambda 需要验证 header 中 token 字符串是否合法，如果合法则继续调用，否则返回 401。

### 使用

在 Lambda 函数中嵌套使用中间件：

```ts
mainApi.post('/api', async ctx => {
  const handler = () => {
    // do something
  }
  await scheduleMiddleware(ctx, handler)
})
```

多个中间件请按参数调用嵌套：

```ts
const authHandler = next => scheduleMiddleware(next, handler)
await authMiddleware(ctx, authHandler)
```

### 错误处理

#### 业务异常

业务中出现需要中断进程的错误，可及时捕获并返回错误信息。

```ts
const request = () => {
  throw new Error('something wrong')
} 
await scheduleMiddleware(ctx, () => {
  try {
    request()
  } catch (err) {
    return HTTP.badGateway(ctx, `${err.message}`)
  }
})
```

#### 运行时的警告

多数场景中，Lambda 并不需要因为单个错误中断流程，可以将错误信息记录到日志，并继续执行。

```ts
const request = async () => {
  const result = await Promise.all([...])
  const errors = result.filter(item => item.status === 'rejected')
  
  // 大于一定数量的错误，直接抛出业务异常
  if (errors.length > 5) {
    throw new Error(errors.map(item => item.reason)
      .join('\n'))
  }
  // 允许范围内，统计警告并继续运行
  if (errors.length > 0) {
    errors.forEach(item => globalWarning.add(item.reason))
  }
}
```
npm package: @mest-fe/prettier
Description: This is prettier config for all MEST projects.
Author: @mest-io
Latest version: 0.1.0

## Prettier config for MEST

This is prettier config for all MEST projects. If you like this style, you can also quote it in your project.

## Usage

1. Install

```bash
yarn add @mest-fe/prettier -D
```

2. Add config to your `package.json`

```json
{
  "prettier": "@mest-fe/prettier"
}
```

## License

[MIT](LICENSE)
npm package: @mest-fe/request-id
Description: This repository integrates Mest internal environment variables and is not suitable for all nestjs projects.
Author: @mest-fe
Latest version: 0.1.1

## Request ID for Mest APIs

This repository integrates Mest internal environment variables and is not suitable for all nestjs projects.

`request-id` will create a unique id for each request as it comes in and write it to the header at the end of the request.

### Usage

1. Install: `pnpm add @mest-fe/request-id`
2. Import and use it in your project:

```ts
import { RequestIdModule } from '@mest-fe/request-id'

@Module({
  imports: [RequestIdModule],
})
export class AppModule {}
```

### LICENSE

[MIT](LICENSE)
npm package: @mestoness/resetcss
Description: Used to reset your page's CSS codes
Author: MestOness
Latest version: 1.0.5

# resetCSS 
### <p align="left"> <img src="https://img.shields.io/github/license/mestoness/resetCSS?style=for-the-badge"/> <img src="https://img.shields.io/npm/v/@mestoness/resetcss?style=for-the-badge"/>  <img src="https://img.shields.io/npm/dt/@mestoness/resetcss?style=for-the-badge"/> </p>
<h3><a href="https://github.com/mestoness/resetcss/archive/master.zip">Download (.zip)</a></h3>	

## Author 
Ahmet Baki Memiş
## Contact
<a href="mailto:resistmaze@gmail.com">Use this address to contact me</a>

## NPM

```
npm install @mestoness/resetcss

```

## CDN

```html
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@mestoness/resetcss/dist/css/resetCSS.min.css">
```