aboutsummaryrefslogtreecommitdiff
path: root/Mammoth/mammoth.edge.js
diff options
context:
space:
mode:
Diffstat (limited to 'Mammoth/mammoth.edge.js')
-rw-r--r--Mammoth/mammoth.edge.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/Mammoth/mammoth.edge.js b/Mammoth/mammoth.edge.js
new file mode 100644
index 0000000..a5a96a9
--- /dev/null
+++ b/Mammoth/mammoth.edge.js
@@ -0,0 +1,18 @@
+;
+return function(data, callback) {
+ var mammoth = module.exports;
+
+ mammoth.convertToHtml({arrayBuffer: toArrayBuffer(data)})
+ .then(function(result) {
+ callback(null, result.value);
+ }, callback);
+
+ function toArrayBuffer(buffer) {
+ var ab = new ArrayBuffer(buffer.length);
+ var view = new Uint8Array(ab);
+ for (var i = 0; i < buffer.length; ++i) {
+ view[i] = buffer[i];
+ }
+ return ab;
+ }
+}; \ No newline at end of file