1.3.2 • Published 5 years ago

serverless-wrap v1.3.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

serverless-wrap

A tiny wrap around serverless, which executes the serverless command.

An excellent candidate to deploy serverless projects in a uniform fashion no matter where it's used and easily integrates with node task runners (e.g.: npm and gulp)

Install

$ npm install --save serverless-wrap

Usage

imports

// default import
import serverless from 'serverless-wrap'

// named import
import { serverless } from 'serverless-wrap';

// multiple named imports
import { deploy, execute } from 'serverless-wrap';

deploy

const args = [
    '--region', 'eu-west-1',
    '--stage', 'development',
    '--verbose'
];

await serverless.deploy(args);

execute

Used to execute any serverless command.

const args = [
    '--region', 'eu-west-1',
    '--stage', 'development',
    '--verbose'
];

await serverless.execute('deploy', args);

environment variables

dotenv is supported; any environment variables are passed on to the serverless command.

const dotenv = require('dotenv');
/*
 * loads configuration from the .env file, e.g.:
 *  process.env.AWS_ACCESS_KEY_ID
 *  process.env.AWS_SECRET_ACCESS_KEY
 *  process.env.AWS_REGION
 */
dotenv.config();

// makes use of the process.env variables
await serverless.deploy(args);
1.3.2

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago