# @midwayjs/serverless-scf-spec

> 根据 scf spec 描述

Latest version **0.1.5** (published 2019-12-22) · 0 weekly downloads

## Install

```sh
npm install @midwayjs/serverless-scf-spec
pnpm add @midwayjs/serverless-scf-spec
yarn add @midwayjs/serverless-scf-spec
bun add @midwayjs/serverless-scf-spec
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2019-12-22 |
| First published | 2019-12-09 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 25.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | czy88840616 |

## Links

- npm: https://www.npmjs.com/package/@midwayjs/serverless-scf-spec
- npm.io page: https://npm.io/package/@midwayjs/serverless-scf-spec

## Dependencies (1)

- [@midwayjs/spec-builder](https://npm.io/package/@midwayjs/spec-builder.md) ^0.1.5

## Recent versions

- 0.1.5 (latest) — 2019-12-22
- 0.1.4 — 2019-12-21
- 0.1.3 — 2019-12-18
- 0.1.2 — 2019-12-13
- 0.1.1 — 2019-12-13
- 0.1.0 — 2019-12-13
- 0.0.10 — 2019-12-11
- 0.0.9 — 2019-12-11
- 0.0.8 — 2019-12-11
- 0.0.7 — 2019-12-11
- 0.0.6 — 2019-12-11
- 0.0.5 — 2019-12-10
- 0.0.4 — 2019-12-10
- 0.0.3 — 2019-12-10
- 0.0.2 — 2019-12-10
- … 1 more at https://npm.io/package/@midwayjs/serverless-scf-spec/versions

## README

# SFC spec generator

根据 scf spec 描述

地址：https://cloud.tencent.com/document/product/583/36198


## API

scf 发布支持多函数，所以直接将 spec 转换为固定的 template.yml，示例见 `/resource` 目录。

**generateFunctionsSpecFile**

根据传入的标准 spec 文件，生成 scf 类型的 spec 文件。

```ts
import { generateFunctionsSpecFile } from '@midwayjs/scf-spec-generator';
import * as path from 'path';

generateFunctionsSpecFile(path.join(__dirname, './fixtures/serverless.yml'));
```

**generateFunctionsSpec**

根据传入的标准 spec 文件，生成 scf 类型的 spec JSON。

```ts
import { generateFunctionsSpec } from '@midwayjs/scf-spec-generator';
import * as path from 'path';

const result = generateFunctionsSpec(path.join(__dirname, './fixtures/fun.yml'));
console.log(result);  // scf spec 的 json
```

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