pixl-xml icon indicating copy to clipboard operation
pixl-xml copied to clipboard

use in node and the browser

Open 73rhodes opened this issue 8 years ago • 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.

73rhodes avatar Jul 04 '17 16:07 73rhodes

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

jhuckaby avatar Jul 06 '17 02:07 jhuckaby