geodesy
geodesy copied to clipboard
add: index.js as "main" entrypoint In package.json.
I recently ran into an issue with Node-Red where I was unable to install your package through NPM automatically in a Function Node, because it lacked the standard "main" entrypoint in the package.json
file.
By doing so there are, of course, trade-offs, but I needed to do so to get it to work with my specific use case. The change in usage would only be in the way classes were imported into projects.
Before:
import LatLon, { Dms } from 'https://cdn.jsdelivr.net/npm/geodesy@2/latlon-ellipsoidal-vincenty.js'; // browser
import LatLon, { Dms } from 'geodesy/latlon-ellipsoidal-vincenty.js'; // Node.js
After:
import LatLon, { Dms } from 'https://cdn.jsdelivr.net/npm/geodesy@2/latlon-ellipsoidal-vincenty.js'; //OR
import LatLonEllipsoidal_Vincenty, { Dms } from 'https://cdn.jsdelivr.net/npm/geodesy@2/index.js'; // browser
import LatLonEllipsoidal_Vincenty, { Dms } from 'geodesy'; //OR
import 'geodesy';
const point = new geodesy.LatLonEllipsoidal(1,1,0); // Node.js