You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

11 lines
355 B

import fs from 'fs-extra';
import path from 'path';
import { isUndefined } from 'lodash';
export default (sslkey, sslcert) =>
isUndefined(sslkey) || isUndefined(sslcert)
? Promise.resolve({})
: Promise.all([
fs.readFile(path.resolve(sslkey)),
fs.readFile(path.resolve(sslcert)),
]).then(([key, cert]) => ({ key, cert }));