geotiffjs / geotiff.js

geotiff.js is a small library to parse TIFF files for visualization or analysis. It is written in pure JavaScript, and is usable in both the browser and node.js applications.
https://geotiffjs.github.io/
MIT License
859 stars 179 forks source link

require() of ES Module quick-lru\index.js not supported when using "const geotiff = require("geotiff") in node" #358

Closed gouthy closed 1 year ago

gouthy commented 1 year ago

Hello, thanks for the package. I am trying to export geotiff through commonjs setup. it says that dependency 'quick-lru' does not support require () of es module. Am i doing something wrong here ?

bright-nwokoro commented 1 year ago

No, you're not. You just have to move your code from commonjs to esmodule. I had the same issue some weeks ago, all I did was just to add "type": "module" to your package.json file and instead of using require you would use import statement. Hope it helps.

gouthy commented 1 year ago

Thanks I figured it out.

LukaszWiktor commented 7 months ago

but readme still stays that you can use require

https://github.com/geotiffjs/geotiff.js?tab=readme-ov-file#usage