Cesiumjs in node script

I would like to write a node script that uses Cesium.Transforms to convert a bunch of ECI points to ECEF. It seemed like things worked until I got this error:

Uncaught ReferenceError: document is not defined

It’s a bit unconventional I know, but I want to write all the transformations to disk for comparison, so I am trying to write node script I can run outside of a browser.

Is this possible or am I wasting my time.


Hi there,

Using the CesiumJS library in a NodeJS script should be possible. We do this internally in a few places in other Cesium products.

Would you mind posting sample code, including how you are importing CesiumJS to your script?