mapbox / shp-write

create and write to shapefiles in pure javascript
BSD 3-Clause "New" or "Revised" License
292 stars 186 forks source link

For zip function, set JSZip type option to nodebuffer if in node environment #24

Closed JasonSanford closed 8 years ago

JasonSanford commented 8 years ago

I was getting strange *.cpgz files after using this library's zip function to create shapefiles in a node environment, which I'm assuming is because the default zip type for JSZip is base64. This PR checks to see if you're running in a node environment, and if so changes the type to 'nodebuffer'.

JasonSanford commented 8 years ago

Thanks for the browserify tip @tmcw. I've pushed that change.

tmcw commented 8 years ago

:+1: thanks!