Use alternatives to nodejs modules
See original GitHub issueHello there!
First, let me say thanks and I love the wkx package! It works great.
One thing I ran across recently was that wkx will not compile in a react-native based project. As far as I can tell, it looks like this is due to the use of util.inherits
and Buffer
The react-native ecosystem does not support any nodejs runtime modules, in this case the util module and the Buffer built-in.
So I was wondering if you would be willing to swap out the node stuff for more portable alternatives like node-util-inherits and buffer instead?
If not, I suppose I could fork wkx, but it seems like a change that might benefit others as well without creating a separate repo.
Anyway, thanks for all the great work.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:13 (1 by maintainers)
Top Results From Across the Web
5 alternatives to Node.js and if this makes sense - Medium
It is often used to solve problems similar to Node.js. ... of RingoJS is based on CommonJS, and you can even use some...
Read more >alternative for module.exports - node.js - Stack Overflow
We have a lint tool that reports illegal use of the assignment expression. We can eleminate them all except for the 'module.exports =...
Read more >Alternatives to __dirname in Node.js with ES modules
ES modules with Node.js add a new, standardized global that allows your code to run anywhere, locally or remotely.
Read more >Alternatives for Node.js environment specific code
Alternatives for Node. js environment specific code - Software Engineering Stack Exchange. Stack Overflow for Teams – Start collaborating and ...
Read more >Try Deno as an alternative to Node.js - Opensource.com
Deno does not use npm. It uses modules referenced as URLs or file paths. · Deno does not use package. · All async...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It is a separate module:
@loaders.gl/wkt
, and it supports code-splitting. Usage. Note you might need to combine withbinaryToGeoJson
from@loaders.gl/gis
because theWKBLoader
’s default output is currently only our binary format.@jayarjo My personal reason for filing this back in 2018 was that Browserify shims nodejs Buffer with https://github.com/feross/buffer which at the time was woefully out of date with current node implementation. There was (still is) a bug with the alternate version of Buffer that would not allow wkx’s unit tests to pass. I had filed a report with the folks over there https://github.com/feross/buffer/issues/197 but it still remains open to this day.
Since it’s been several years, I have moved on from the project I was working on at the time, and haven’t had a chance to revisit the original (this) issue. (that was a React Native project)
My exchange with @kylebarron was really intriguing, and I suspect that it might be possible to completely remove the need to use browserify, however I simply haven’t had any time to look into Kyle’s suggestion either.
I’m happy to close this out if it’s no longer of interest to anyone, or if @cschwarz doesn’t want any modifications to wkx (after all, my react-native use case wasn’t really in the scope of this repo), but I’m also happy to help review PRs if they come along.
cheers!