From 54d10f8d06c18917b97c67d245d1559134f5e2d8 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 23 Mar 2014 11:59:01 +0000 Subject: Add notes on browser usage --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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`: -- cgit v1.2.3