Skip to content

Commit

Permalink
fix(node6): support node 6 (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Ross authored Apr 30, 2018
1 parent 1520ebc commit 42fa44e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
"dependencies": {
"@types/argparse": "^1.0.33",
"@types/aws-sdk": "^2.7.0",
"@types/bluebird": "^3.5.20",
"@types/js-yaml": "^3.11.1",
"@types/node": "^9.6.4",
"argparse": "^1.0.10",
"aws-sdk": "^2.224.1",
"bluebird": "^3.5.1",
"js-yaml": "^3.11.0",
"nodecredstash": "^2.0.2"
},
Expand Down
6 changes: 4 additions & 2 deletions src/resolvers.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as AWS from 'aws-sdk';
import { CloudFormation } from 'aws-sdk';
import { DescribeStacksOutput } from 'aws-sdk/clients/cloudformation';
import { promisify } from 'util';

const Credstash = require('nodecredstash');

import { promisify } from 'bluebird';

import { ResolverMap, Config } from './types';


Expand Down Expand Up @@ -47,7 +49,7 @@ export const resolvers: ResolverMap = {
},
cred: async (argument: string, config: Config) => {
const credstash = new Credstash({ awsOpts: { region: config.awsRegion } });
const promisified = promisify(credstash.getSecret);
const promisified = promisify<string, object>(credstash.getSecret, { context: credstash });
return promisified({ name: argument })
.catch((error: Error): string => {
console.warn(`Could not load value ${argument} from credstash: ${error}`);
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
dependencies:
aws-sdk "*"

"@types/bluebird@^3.5.20":
version "3.5.20"
resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.20.tgz#f6363172add6f4eabb8cada53ca9af2781e8d6a1"

"@types/js-yaml@^3.11.1":
version "3.11.1"
resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.11.1.tgz#ac5bab26be5f9c6f74b6b23420f2cfa5a7a6ba40"
Expand Down

0 comments on commit 42fa44e

Please sign in to comment.