Page 1 of 1

chronograph in Nodejs Context

Posted: Wed Dec 02, 2020 8:15 am
by rahulranjan

Hi
How can we implement chronograph in Nodejs Context with basic set up ?


Re: chronograph in Nodejs Context

Posted: Wed Dec 02, 2020 9:28 am
by nickolay

Hi,

Chronograph is written "isomorphically" - using only Ecma modules "imports". It will work the same way both in browsers and Node. In Node, if version is < 14 you'll need to use "esm" module: https://www.npmjs.com/package/esm

node -r esm your_code.js

If version is > 14, then you can name your file with *.mjs extension or set the "type : 'module'" property in the package.json. See here for more details: https://nodejs.org/dist/latest-v14.x/docs/api/packages.html#packages_determining_module_system