mbostock / file-source Goto Github PK
View Code? Open in Web Editor NEWRead files as standard WhatWG streams in Node.
License: Other
Read files as standard WhatWG streams in Node.
License: Other
This API is currently Node-specific since the source.read interface returns a Buffer. If we changed it to return an ArrayBuffer (or DataView) instead, then it could be used in both Node and the browser.
Unfortunately, Node doesn’t support TextDecoder yet, which is part of the Encoding Living Standard. But then, neither do Safari or IE. 😦 I’m not currently using the source.readString feature—I’m using iconv-lite for dbf parsing—so one option might be to drop this method from the source interface. Though that would simply punt the work to shapefile if the goal is to get that working in the browser.
I was trying to run shp2json
from your shapefile package and I ran into an error that Promise
is not defined in file-source
:
/usr/local/lib/node_modules/shapefile/node_modules/path-source/node_modules/file-source/index.js:7
return new Promise(function(resolve, reject) {
^
ReferenceError: Promise is not defined
According to this stackoverflow answer it looks like Node didn't add Promise
until version 0.12, and I'm stuck on an earlier version because it's the version we use to build our package:
$ node --version
v0.10.25
Would it be possible to update the package.json
to specify the engines supported, so it'll fail at install time? It looks like this is the way to do that.
Thanks,
Ryan
Should perhaps allow options = {highWaterMark: 65536} to file(path[, options]). The other options don’t seem applicable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.