aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-03-23 11:59:01 +0000
committerMichael Williamson <mike@zwobble.org>2014-03-23 11:59:01 +0000
commit54d10f8d06c18917b97c67d245d1559134f5e2d8 (patch)
tree2718445b44b6626ceded04cc05c68a3694a20f1d
parenteca70c03ccfb8576039d61184649ed4858b1bd3d (diff)
Add notes on browser usage
-rw-r--r--README.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md
index 61a37d8..a559d6c 100644
--- a/README.md
+++ b/README.md
@@ -61,6 +61,18 @@ Where `custom-style-map` looks something like:
### Library
+In node.js, mammoth can be required in the usual way:
+
+```javascript
+var mammoth = require("mammoth");
+```
+
+To generate a standalone JavaScript file for the browser,
+use `mammoth.browser.js` (generate using `make setup` if it is not already present).
+This uses any loaded module system.
+If no module system is found,
+`mammoth` is set as a window global.
+
#### Basic conversion
To convert an existing .docx file to HTML, use `mammoth.convertToHtml`: