Created
October 12, 2018 19:39
-
-
Save kmaher9/6627e401b04b90909263215f81764f69 to your computer and use it in GitHub Desktop.
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
| extract: function(filePath) { | |
| return new Promise( | |
| function(resolve, reject) { | |
| module.exports.open(filePath).then(function (res, err) { | |
| if (err) { | |
| reject(err) | |
| } | |
| var body = '' | |
| var components = res.toString().split('<w:t') | |
| for(var i=0;i<components.length;i++) { | |
| var tags = components[i].split('>') | |
| var content = tags[1].replace(/<.*$/,"") | |
| body += content+' ' | |
| } | |
| resolve(body) | |
| }) | |
| } | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment