I am kind of unfamiliar with running javascript from command line, but I am in a situation where need to use a NPM package for a Panasonic AC, that has a wrapper for their unofficial API.
However, I want to make a simple JS that I can run from command line, that will import the NPM package. But this only generates error:
(node:68628) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/Ronny/Documents/AC/index.js:1
import { ComfortCloudClient } from 'panasonic-comfort-cloud-client'
^^^^^^
SyntaxError: Cannot use import statement outside a module
Is it not possible to do this?