open-index/open-npm huggingface dataset:
npm package: @serverless-components/utils-aws
Description: ## AWS-related utilities for Serverless Compose
Author: serverless.com
Latest version: 0.1.0

# @serverless-components/utils-aws

## AWS-related utilities for Serverless Compose

### Installation

```bash
npm install @serverless-components/utils-aws
```

### Utilities

- [`getCredentialProvider`](docs/get-credential-provider.md)
- [`getRegion`](docs/get-region.md)
npm package: @serverless-contracts/eslint-plugin
Description: An eslint plugin with rules to enforces proper usage of contracts.
Author: fargito
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @serverless-contracts/eslint-plugin

An eslint plugin with rules to enforces proper usage of contracts.

### Installation

```bash
npm install --save-dev @serverless-contracts/eslint-plugin
```

or if using yarn

```bash
yarn add --dev @serverless-contracts/eslint-plugin
```

### Usage

Add `@serverless-contracts` to the plugins section of your `.eslintrc` configuration file, then configure the rules you want to use under the rules section.

```json
{
  "plugins": ["@serverless-contracts"],
  "rules": {
    "@serverless-contracts/rule-name": "error"
  }
}
```

You can also enable all the recommended rules for our plugin. Add `plugin:@serverless-contracts/recommended` in extends:

```json
{
  "extends": ["plugin:@serverless-contracts/recommended"]
}
```

### Rules

**Key**: :white_check_mark: = recommended, :wrench: = fixable

| Name                                            | Description                                                            | :white_check_mark: | :wrench: |
| ----------------------------------------------- | ---------------------------------------------------------------------- | ------------------ | -------- |
| `@serverless-contracts/no-undeclared-contracts` | Require that used contracts are defined in the serverless service file | :white_check_mark: |          |
npm package: @serverless-contracts/plugin
Description: A plugin to safely deploy Serverless microservices.
Author: fargito
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @serverless-contracts/plugin

A plugin to safely deploy Serverless microservices.

This plugin is part of the [serverless-contracts](https://github.com/fargito/serverless-contracts) project. See its documentation for more insights.

## Installation

```bash
npm install @serverless-contracts/plugin --save-dev
```

Or if you're using yarn

```bash
yarn add -D @serverless-contracts/plugin
```

Then in your `serverless.ts` file, add `@serverless-contracts/plugin` to the list of your plugins.

## Configuration

Add a `contracts` key to your Serverless file:

```ts

import { myFirstContract, mySecondContract } from 'my-contracts-package';
import { consumedContract } from 'other-contracts';

const serverlessConfigation = {
    service: 'my-app',
    provider: {
        name: aws
    },
    plugins: ['@serverless-contracts/plugin'],
    functions: {
        ...
    },
    contracts: {
        provides: {
            myFirstContract: myFirstContract.fullContractSchema,
            mySecondContract: mySecondContract.fullContractSchema
        },
        consumes: {
            consumedContract: consumedContract.fullContractSchema,
        },
    },
}
```

Where all the contracts are defined using [serverless-contracts](https://github.com/fargito/serverless-contracts).

## Commands

- `serverless localContracts`: prints the local version of the contracts
- `serverless remoteContracts`: prints the currently deployed version of the contracts
- `serverless safeDeploy --strategy <strategy>`: a wrapper around the `deploy` command of the Serverless Framework, check if the contracts modification is deployable with the chosen strategy. Choices are `PROVIDER_FIRST` or `CONSUMER_FIRST`

## Typing

This plugin exposes its own types. In order to properly type your Serverless service file:

```ts
import { ServerlessContracts } from '@serverless-contracts/plugin';
import { AWS } from '@serverless/typescript';

const serverlessConfiguration: AWS & ServerlessContracts = {
    ...
}
```
npm package: @serverless-dev/s
Description: Serverless devs tool, serverless developer tool, supports Alibaba cloud, AWS, azure, baidu cloud, Huawei cloud, Google cloud and Tencent cloud.
Latest version: 0.0.5

# 欢迎使用Serverless Devs Tool

感谢您关注Serverless Devs Tool，也非常感谢您查看本文档。

您可以根据以下链接，迅速寻找到所需要的文档内容：

## 项目介绍

* [项目介绍](./docs/others/introduce.md)

## 入门相关

* [快速开始](./docs/usage/start.md)
* [安装文档](./docs/usage/install.md)
* [账号配置](./docs/usage/access.md)
* [Yaml配置](./docs/usage/yaml.md)

## 指令相关

* [Config指令](./docs/commands/config.md)
* [Init指令](./docs/commands/init.md)
* [Search指令](./docs/commands/search.md)
* [Set指令](./docs/commands/set.md)
* [Platform指令](./docs/commands/platform.md)

# 高级玩法

* [泛指令](./docs/commands/component-command.md)

## 常见问答：

* [常见问答](./docs/usage/faq.md)

## 联系我们

Serverless Devs邮箱地址：service@serverlessfans.com

## 关于Serverless Devs

我们是一群开发者，一群Serverless的爱好者，我们开源，我们开放，我们期待您的加入。我们的工具，不以任何厂商为核心，只以开发者为核心，我们期待更多的开发者，可以为"开发者群体"服务，服务自己，创造更多价值。

和我们一起，Go Serverless
npm package: @serverless-devs/alireadme
Description: This is a component demo for Serverless Devs Tool 
Author: Serverless-Devs
Latest version: 0.0.3

# 阿里云应用帮助文档标准化工具

使用流程：

1. 如果没有登陆 Serverless Registry，需要执行 s cli registry login 进行登录
2. 在 Serverless Devs 的应用项目目录下，执行 s cli alireadme （即与 publish.yaml 平级的路径执行）
3. 在浏览器中，可以看到帮助文档的在线编辑： 只需要在左侧进行编辑，即可实现实时预览，完成之后点击右下角的保存，即可存到 readme.md 文件。

ps：关于图床空间，每个 Serverless Registry 账号默认的图床大小为 50M，账号下应用组件下载次数每下载超过 100 次，即可获得 1M 的空间。
npm package: @serverless-devs/downloads
Description: download for serverless-devs
Author: xsahxl
Latest version: 0.0.7


# 下载(@serverless-devs/downloads)

## 安装

```bash
$ npm install @serverless-devs/downloads --save
```

## 基本使用

```ts
import downloads from '@serverless-devs/downloads';

downloads('https://registry.devsapp.cn/simple/devsapp/core/zipball/0.1.54')
```

## 参数解析

```ts
import downloads from '@serverless-devs/downloads';
downloads(url, options)
```

| 参数    | 说明            | 类型    | 必填 | 默认值 |
| ------- | --------------- | ------- | ---- | ------ |
| url | 下载地址 | string       | 是   |        |
| options | 方法入参 | Options | 否   |        |

## Options

| 参数      | 说明         | 类型                          | 必填 | 默认值        |
| --------- | ------------ | ----------------------------- | ---- | ------------- |
| ...[DecompressOptions](https://github.com/kevva/decompress#options)  |  |      |    |   |
| dest | 文件保存路径 | string | 否   |        |
| logger | 输出日志 | Function | 否   |   console     |
| extract  | 文件是否解压 | boolean                     | 否   |  false |
| filename | 文件保存的名称  | string                       | 否   |         demo.zip      |
| strip    | 解压文件时的提取层级   |  number     | 否   |      0         |
npm package: @serverless-devs/ignore-walk
Description: ignore-walk for serverless-devs
Author: wss-git
Latest version: 0.0.2-beta.4


# ignore (@serverless-devs/ignore-walk)

## 安装

```bash
$ npm install @serverless-devs/ignore-walk --save
```

## 基本使用

```ts
import ignoreWalk from '@serverless-devs/ignore-walk';

const zipFiles = ignoreWalk.sync({
  ignoreFiles: ['.fcignore'],
  path: path.join(__dirname, 'code'),
  includeEmpty: true,
});
```

## 参数解析

```ts
import ignoreWalk from '@serverless-devs/ignore-walk';

const result = ignoreWalk.sync(Options);
```

## Options

| 参数      | 说明         | 类型                          | 必填 | 默认值        |
| --------- | ------------ | ----------------------------- | ---- | ------------- |
| path  | 计算代码包的根目录 |   string   |  否  |  process.cwd() |
| ignoreFiles | ignore 文件名列表 | string[] | 否   |    ['.signore']    |
| includeEmpty | 包含空白目录 | boolean | 否   |   false     |
| follow  | 保留符号链接目录 | boolean   | 否   |  false |
| isSymbolicLink  | 如果 path 是符号链接，则设置为true，无论follow是否为true | boolean   | 否   |  - |
npm package: @serverless-devs/kv
Description: 发布 阿里云 jamstack 站点 kvstore 的组件
Author: Serverless-Devs
Latest version: 0.0.7

## 组件说明

## 使用场景

## 具体用法

### s cli 方式

```
s cli <componentname> -d
```

### 应用编排使用方式

查看 example下 s.yaml
npm package: @serverless-devs/orm
Description: orm for serverless-devs
Author: heimamba
Latest version: 0.0.3-beta.1

# ORM(@serverless-devs/orm)
### 依赖
- [lowdb](https://github.com/typicode/lowdb)，本地JSON数据库，但是不支持`ESM`
- [loopback-filters](https://github.com/strongloop/loopback-filters)，`ORM`过滤模块

## 安装

```bash
$ npm install @serverless-devs/orm --save
```

## 使用方式

```ts
import ORM from '@serverless-devs/orm';

```
### create
```ts
const tableName = 'posts';
const orm = new Orm('./post.json', {
  [tableName]: [],
  users: []
});
const tableValue = 'dankun_1';

await orm.init();
await orm[tableName].create({
    data: {
        name: tableValue,
    },
});
```

### find
#### findUnique
```
const data = await orm[tableName].findUnique({
    where: {
      name: 'case_1',
    },
});
```
#### findMany
```
const data = await orm[tableName].findMany({
    where: {
        name: 'case_1',
    },
});
```
### update
```
const data = await orm[tableName].update({
    where: {
      name: 'case_1',
    },
    data: {
      name: 'case_update',
      age: 23,
    },
});
```
### delete
```
const data = await orm[tableName].delete({
    where: {
      name: 'case_1',
    },
});
```

## 参数解析

### query 搜索
### 初始化参数解析
```
// path 参数指的是文件路径，比如`～/.s/error.json`
const orm = new Orm($path);
// tableName参数指的是实体名
await orm.init($tableName);
```
#### 参数解析
- path
参数指的是文件路径，比如`～/.s/error.json`
- tableName
`tableName`参数指的是表的实体名



#### where搜索
```
applyFilter({
  where: {
    // the price > 10 && price < 100
    and: [
      {
        price: {
          gt: 10
        }
      },
      {
        price: {
          lt: 100
        }
      },
    ],

    // match Mens Shoes and Womens Shoes and any other type of Shoe
    category: {like: '.* Shoes'},

    // the status is either in-stock or available
    status: {inq: ['in-stock', 'available']}
  }
})
```

#### limit
```
applyFilter(data, {
  where: {
    location: {near: '153.536,-28'}
  },
  limit: 10
})
```

## 参考
[prisma](https://www.prisma.io/docs/concepts/components/prisma-client/crud)
npm package: @serverless-devs/progress-bar
Description: progress-bar for serverless-devs
Author: wss-git
Latest version: 0.0.3-beta.2


# 下载(@serverless-devs/progress-bar)

## 安装

```bash
$ npm install @serverless-devs/progress-bar --save
```

## 基本使用

```ts
import ProgressBar, { ProgressType } from '@serverless-devs/progress-bar';

const bar = new ProgressService(
  ProgressType.Loading,
  {
    total: 1000,
  }
);
for (let i = 0; i < 1000; i += 50) {
  bar.update(i);
}
bar.complete();
```

## 参数解析

```ts
import ProgressBar, { ProgressType } from '@serverless-devs/progress-bar';

const result = new ProgressService(
  type,
  options,
  format,
);
```

| 参数    | 说明            | 类型    | 必填 | 默认值 |
| ------- | --------------- | ------- | ---- | ------ |
| type | 进度条的显示方式 | `ProgressType.Bar`：总尺寸已知的进度条;  `ProgressType.Loading`：总大小未知的加载样式 | 是   |     -   |
| options | 进度条的选项 | [Options](#options) | `ProgressType.Bar` 时必填   |      -  |
| format | 进度条格式, 详见[format](#format) | String | 否   |  - |


## Options

| 参数      | 说明         | 类型                          | 必填 | 默认值        |
| --------- | ------------ | ----------------------------- | ---- | ------------- |
| total    | 要完成的数据总数   |  number     | 是   |      `ProgressType.Loading` 时默认 100         |
| curr    | 当前已完成索引   |  number     | 否   | - |
| width    | 进度条显示宽度   |  number     | 否   | `{total}` |
| renderThrottle    | 更新之间的最短时间（以毫秒为单位）   |  number     | 否   | 16 |
| stream    | 输出流 |  NodeJS.WritableStream     | 否   | `{process.stderr}` |
| head    | 头部字符, 默认为完成字符   |  string  | 是   | `{complete}` |
| complete    | 完成字符 |  string    | 否   | `=` |
| incomplete    | 未完成字符 |  string    | 否   | `-` |
| callback    | 进度条完成时调用 |  Function    | 否   | - |


## Format 简述

type 取值 `ProgressType.Bar` 时默认为 `Loading ${green(':loading')} ((:bar)) :current/:total(Bytes) :percent :etas`     
type 取值 `ProgressType.Loading` 时默认为 `Loading ${green(':loading')} ((:bar)) :etas`

  
解析一下这段文字 `Loading ${green(':loading')} ((:bar)) :current/:total(Bytes) :percent :etas`：

`Loading` 是一个显示前缀，可以替换为一些固定的文案。  
`green()` 是引入的 [chalk](https://www.npmjs.com/package/chalk), 显示一下颜色效果  
`:loading` 是 `['⣴', '⣆', '⢻', '⢪', '⢫']` 交替显示的一个动态效果  
`((:bar))` 是显示进度条，由参数 `options.total` 控制总长度，使用 `result.update(curr)` 修改显示完成度。  
`:current` 显示当前完成度  
`:total` 要完成的数据总数  
`:percent` 完成的百分比  
`:etas` 估计完成时间（以秒为单位）  
`:elapsed` 经过的时间（以秒为单位）  
`:rate` 每秒刻度数  

## result

#### result.update

更新进度状态

接受参数为 `number` 类型  
返回值 无

示例：
```js
result.update(50)
```

#### result.terminate

中断进度条显示，并在上面写一条消息（此条信息不会被删除）

接受参数 `string`
返回值 无

示例：
```js
result.interrupt('终')
```

#### result.terminate

终止显示

接受参数 无  
返回值 无

示例：
```js
result.terminate()
```

#### result.complete

获取完成状态

接受参数 无  
返回值 `boolean`

示例：
```js
const complete = result.complete()
```

#### result.curr

获取当前已完成索引

接受参数 无  
返回值 `number`

示例：
```js
const curr = result.curr()
```

#### result.total

获取要完成的数据总数

接受参数 无  
返回值 `number`

示例：
```js
const total = result.total()
```
npm package: @serverless-devs/s-framework
Description: Serverless Devs Tool Framework Component For Alibaba Cloud
Author: Serverless-Devs
Latest version: 0.0.22

# Serverless Devs Tool Alibaba Cloud 框架核心组件库

## 前言
该组件库是Serverless Devs Tool针对阿里云函数计算制作的框架核心组件库。

通过该组件库，您可以简单快速的部署一个上层应用。

## 使用方法

该组件库实底层依赖Serverless Devs Tool的fc-alibaba组件库，所支持的能力主要包括部署，移除等操作。

以部署为例：

- 导入组件库

    ```typescript
    import Framework = require('@serverless-devs/s-framework');
    ```
 
- 使用组件进行部署

    ```typescript
    class NuxtComponent extends Framework {
      async deploy(inputs: InputsContext) {
        return await super.deploy(inputs);
      }
    }
    ```

## 联系我们

- 社区网站：www.serverlessfans.com
- 社区邮箱：service@serverlessfans.com
npm package: @serverless-devs/serverless-http
Description: Use existing web application frameworks in serverless environments
Author: Doug Moscrop
Latest version: 3.0.1

# serverless-http

[![Build Status](https://travis-ci.org/dougmoscrop/serverless-http.svg?branch=master)](https://travis-ci.org/dougmoscrop/serverless-http)

## 2.0

The 2.0 release moves to async/await and requires Node 8+.

All frameworks have been updated to their latest versions.

## Description

This module allows you to 'wrap' your API for serverless use. No HTTP server, no ports or sockets. Just your code in the same execution pipeline you are already familiar with.

## Support

### Supported Frameworks
(* Experimental)

* Connect
* Express
* Koa
* Restana
* Sails *
* Hapi *
* Fastify *
* Restify *
* Polka *
* Loopback *

### Supported Providers

* AWS
* Azure (Experimental, untested, probably outdated)

## Examples

Please check the `examples` folder!

### Usage example using the Koa framework

```javascript
const serverless = require('serverless-http');
const Koa = require('koa'); // or any supported framework

const app = new Koa();

app.use(/* register your middleware as normal */);

// this is it!
module.exports.handler = serverless(app);

// or as a promise
const handler = serverless(app);
module.exports.handler = async (event, context) => {
  // you can do other things here
  const result = await handler(event, context);
  // and here
  return result;
};
```

### Usage example using the Express framework with Azure

```javascript

const serverless = require('serverless-http');
const express = require('express');

const app = express();

app.use(/* register your middleware as normal */);

const handler = serverless(app, { provider: 'azure' });
module.exports.funcName = async (context, req) => {
  context.res = await handler(context, req);
}

```

### Other examples
[json-server-less-λ](https://github.com/pharindoko/json-server-less-lambda) - using serverless-http with json-server and serverless framework in AWS


## Limitations

Your code is running in a serverless environment. You cannot rely on your server being 'up' in the sense that you can/should not use in-memory sessions, web sockets, etc. You are also subject to provider specific restrictions on request/response size, duration, etc.

> Think of this as a familiar way of expressing your app logic, *not* trying to make serverless do something it cannot.

## Contributing

Pull requests are welcome! Especially test scenarios for different situations and configurations.

## Further Reading

Here are some [more detailed examples](./docs/EXAMPLES.md) and [advanced configuration options](./docs/ADVANCED.md) as well as [provider-specific documentation](./docs/PROVIDERS.md)
npm package: @serverless-devs/zip
Description: zip for serverless-devs
Author: wss-git
Latest version: 0.0.3-beta.8


# 压缩(@serverless-devs/zip)

## 安装

```bash
$ npm install @serverless-devs/zip --save
```

## 基本使用

```ts
import zip from '@serverless-devs/zip';

zip({ codeUri: './code' })
```

## 参数解析

```ts
import zip from '@serverless-devs/zip';
const result = await zip(options)
```

## Options

| 参数      | 说明         | 类型                          | 必填 | 默认值        |
| --------- | ------------ | ----------------------------- | ---- | ------------- |
| codeUri    | 代码包路径   |  string     | 是   |  - |
| includes    | 额外的压缩代码目录   |  string[]     | 否   |  - |
| outputFilePath    | 压缩文件输出目录   |  string     | 否   |  `process.cwd()` |
| outputFileName    | 压缩文件输出名称   |  string     | 否   |  `${Date.now()}.zip` |
| ignoreFiles    | 代码包忽略声明文件名称   |  string[]     | 否   |  `['.signore']` |
| level    | 压缩级别   |  number     | 否   |  9 |
| prefix    | 新增压缩目录前缀   |  string     | 否   |  - |

## Result

| 参数      | 说明   | 类型   |
| --------- | ------------ | ---- |
| count | 被压缩的文件个数 | number |
| compressedSize | 生成文件的大小 | number |
| outputFile | 生成文件的本地地址 | string |