From d3b5e999c89671f3fbe5e0cb7d0f4cc15c0d473d Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Sat, 5 Sep 2015 14:11:49 -0700 Subject: [PATCH] export as a common js module Useful for people wanting to use browserify/webpack --- canvas2svg.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/canvas2svg.js b/canvas2svg.js index ff09f8a..038e6a8 100644 --- a/canvas2svg.js +++ b/canvas2svg.js @@ -1104,4 +1104,9 @@ //add options for alternative namespace window.C2S = ctx; + // CommonJS/Browserify + if (typeof module === "object" && typeof module.exports === "object") { + module.exports = ctx; + } + }());