jhuckaby/pixl-xml

use in node and the browser

Opened this issue · 1 comments

Thanks for this library! I really like the no-dependencies aspect, although it actually does depend on a couple of native node modules. It would be great to be able to use this within the browser, but the require('fs') and require('util') dependencies limit it to use with nodejs. Unfortunately, trying to detect the node vs. browser environment and conditionally requiring fs and util doesn't work well with webpack. Since util is only used for a deprecated util.isArray reference, it could probably be safely removed or pollyfilled. And reading from a file is a nice feature but it could be separate from the core library so it's usable both client and server side.

Thanks! I'll try to figure out a nice way to separate out the core library, and then have Node.js and browser versions.