This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| When using AWS SES and attempting to send emails over SMTP using | |
| an custom IAM user, the user needs to have the SendRawEmail permission. | |
| The SMTP username is the AWS Access Key ID while the SMTP password must | |
| be calculated using a *special* (ahem, ahem) algorithm mentioned in AWS | |
| docs here: https://docs.aws.amazon.com/ses/latest/dg/smtp-credentials.html | |
| This function is a Node.js compliant port of the pseudocode mentioned on | |
| that page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| var deleteFolderRecursive = function(path) { | |
| if( fs.existsSync(path) ) { | |
| fs.readdirSync(path).forEach(function(file,index){ | |
| var curPath = path + "/" + file; | |
| if(fs.lstatSync(curPath).isDirectory()) { // recurse | |
| deleteFolderRecursive(curPath); | |
| } else { // delete file | |
| fs.unlinkSync(curPath); | |
| } |