serverless-yaml2ts
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

serverless-yaml2ts

Simple convertor from serverless.yml to serverless.ts

oclif Version Downloads/week License

Before

service:
  name: example-project
frameworkVersion: '>=1.72.0'
custom:
  webpack:
    webpackConfig: ./webpack.config.js
    includeModules: true
 
plugins:
  - serverless-webpack
 
provider:
  name: aws
  runtime: nodejs12.x
  apiGateway:
    minimumCompressionSize: 1024
  environment:
    AWS_NODEJS_CONNECTION_REUSE_ENABLED: 1
 
functions:
  hello:
    handler: handler.hello
    events:
      http:
          method: get
          path: hello
 

After

import { Serverless } from 'serverless/aws';
export const service: Serverless = {
  "service": {
    "name": "example-project"
  },
  "frameworkVersion": ">=1.72.0",
  "custom": {
    "webpack": {
      "webpackConfig": "./webpack.config.js",
      "includeModules": true
    }
  },
  "plugins": [
    "serverless-webpack"
  ],
  "provider": {
    "name": "aws",
    "runtime": "nodejs12.x",
    "apiGateway": {
      "minimumCompressionSize": 1024
    },
    "environment": {
      "AWS_NODEJS_CONNECTION_REUSE_ENABLED": 1
    }
  },
  "functions": {
    "hello": {
      "handler": "handler.hello",
      "events": [
        {
          "http": {
            "method": "get",
            "path": "hello"
          }
        }
      ]
    }
  }
}
 
module.exports = service

Usage

$ npm install -g serverless-yaml2ts
$ sls-yaml2ts COMMAND
running command...
$ sls-yaml2ts (-v|--version|version)
serverless-yaml2ts/0.0.3 darwin-x64 node-v12.9.1
$ sls-yaml2ts --help [COMMAND]
USAGE
  $ sls-yaml2ts COMMAND
...

Commands

Readme

Keywords

Package Sidebar

Install

npm i serverless-yaml2ts

Weekly Downloads

102

Version

0.0.3

License

MIT

Unpacked Size

8.03 kB

Total Files

7

Last publish

Collaborators

  • hideokamoto