If you're not familiar with the different ways that you can use JavaScript modules, I suggest you find an article or a wiki page. There are way more qualified people that can explain this better than me.
Obviously, this module wasn't meant to be used server side.
If you're using TypeScript or require
, you're gonna need a bundler like
rollup,
browserify, or
webpack.
Node resolution:
const browserZoomListener = require("browser-zoom-listener");
Just a file:
const browserZoomListener = require("./dist/lib.cjs");
import browserZoomListener from "./dist/lib.mjs";
import browserZoomListener from "browser-zoom-listener/src/lib";
// works without synthetic default export
<script src="./dist/lib.iife.js"></script>
<script>
browserZoomListener;
</script>
Copy the stuff in this file.
It's one big expression that goes into browserZoomListener
.
Don't worry about licencing because it's free and unencumbered software.