-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require Support #81
Comments
Version 2 of the geodesy library was a significant development, including adding modern reference frames in addition to traditional datums, and refactoring & extending n-vector functions. I had to use ES6 modules to achieve the new functionality due to the more complex interdependencies. You're welcome to continue using version 1. What is the reason you don't want to use |
Hi @chrisveness – I haven't coded in 7 years and I haven't caught up with the differences yet. Also I don't do client side development so have no need for any of such features, in the server it actually makes code a bit less easy to read to have a mixture of requires and imports. Why would something import but not work with require? can't you simply module.export it if module exists? Thanks for the prompt reply and amazing work, this works incredibly well. I was able to code a simple way to snap my runs to a route in a couple of hours of work!! Thank you |
ES modules (using Unfortuntely, ESM is generally incompatible with CommonJS (which uses However, ESM has many advantages over CommonJS (static, asynchronous, isomorphic, etc), and is certainly the future for JavaScript. exploringjs.com/es6/ch_modules.html has good information. Saying that, you should be able to use dynamic import to include ES module files from CommonJS code, though I've not tried it myself: nodejs.org/api/esm.html#esm_import_expressions. |
Thanks Chris. Still strange not being able to require something you npm installed, definitely an anti-pattern. Appreciate all the feedback hopefully other with the same issue will know the solution is to use version 1.1.3! |
Was trying to use the module in node.js but couldn't require it. Ended up installing version 1.1 from npm to circumvent this issue.
Any specific reason not to support require?
The text was updated successfully, but these errors were encountered: