I have a NodeJS script that needs to get the devices' screen size. I've found an npm package that does this, but since it gets the screen dimensions using the window object, I cannot include it in the NodeJS script.
Is there a way to define an npm script (defined in package.json as something like "run": "npm run getDimensions.js | node index") that will run the clientside JS to get screen dimensions, then pipe the height and width to the serverside NodeJS, or save it to a configuration file, or something?