Skip to content

Instantly share code, notes, and snippets.

@kmaher9
Created October 12, 2018 19:39
Show Gist options
  • Save kmaher9/6627e401b04b90909263215f81764f69 to your computer and use it in GitHub Desktop.
Save kmaher9/6627e401b04b90909263215f81764f69 to your computer and use it in GitHub Desktop.
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