1.0.0 • Published 4 years ago

serverless-yaml v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

serverless-yaml

Utility for extending serverless yml based on common components from dependencies.

Usage

Create files that are useful in a "serverless" subdirectory in a dependency or in the top level package with names that point to the path within the serverless object you want to update, like:

  • provider.environment.yml - a map of environment variables to be added to provider.envrionment for common usage
  • Resources.mainRole.Properties.Policies.yml - a list of policies to add to the the roles called mainRole.

Supports yaml encoding (detected by .yml or .yaml extension) and JSON (.json)

Usage

npx serverless-yaml [options]

Update serverless yml based on partials in depedencies

Options

  • -y --yaml-file \<path> Serverless yml file to inspect (default: ./serverless.yml)
  • -o --output \<path> Output file (default is same as input serverless file)
  • -w --working-path \<path> Working path for node project (default: .)

serverless-yaml - v1.0.0

Index

Functions

Functions

apply

apply(source: object, key: string, objOrArray: object | any[]): undefined | object

Defined in index.ts:30

Parameters:

NameType
sourceobject
keystring
objOrArrayobject | any[]

Returns: undefined | object


getAllDependencies

getAllDependencies(path: string): string, string

Defined in bin.ts:9

Parameters:

NameTypeDefault
pathstringprocess.cwd()

Returns: string, string


inspectDependency

inspectDependency(path: string): object

Defined in index.ts:5

Parameters:

NameType
pathstring

Returns: object

  • key? : undefined | string

  • value? : any[] | object