Skip to content

Commit 55edb5d

Browse files
ulionDeviaVir
authored andcommitted
Support to use package.json description (#133)
1 parent 57f72d0 commit 55edb5d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bin/node-lambda

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ var dotenv = require('dotenv');
44
var lambda = require('../lib/main.js');
55
var program = require('commander');
66
var fs = require('fs');
7-
var packageJsonName = fs.existsSync(process.cwd() + '/package.json')
8-
? require(process.cwd() + '/package.json').name : 'UnnamedFunction';
7+
var packageJson = fs.existsSync(process.cwd() + '/package.json')
8+
? require(process.cwd() + '/package.json') : {};
9+
var packageJsonName = packageJson.name || 'UnnamedFunction';
910

1011
dotenv.load();
1112

@@ -21,7 +22,7 @@ var AWS_HANDLER = process.env.AWS_HANDLER || 'index.handler';
2122
var AWS_ROLE = process.env.AWS_ROLE_ARN || process.env.AWS_ROLE || 'missing';
2223
var AWS_MEMORY_SIZE = process.env.AWS_MEMORY_SIZE || 128;
2324
var AWS_TIMEOUT = process.env.AWS_TIMEOUT || 60;
24-
var AWS_DESCRIPTION = process.env.AWS_DESCRIPTION || '';
25+
var AWS_DESCRIPTION = process.env.AWS_DESCRIPTION || packageJson.description || '';
2526
var AWS_RUNTIME = process.env.AWS_RUNTIME || 'nodejs4.3';
2627
var AWS_PUBLISH = process.env.AWS_PUBLISH || false;
2728
var AWS_FUNCTION_VERSION = process.env.AWS_FUNCTION_VERSION || '';

0 commit comments

Comments
 (0)