Search code examples
node.jstypescriptrequire

I would like to use Pond.js but cannot figure out how to require it


I am using node.js (not typescript) and would like to perform some aggregation on time series data. I came across Pond.js (https://github.com/esnet/pond) which seems to have the functionality I need. Unfortunately, I was hot able to use it in my project.

I did npm install and my package.json includes: "pond": "1.0.2". The recommended approach (http://software.es.net/pond/#/) is:

const {TimeSeries} = require("pond"); // instructions write "pondjs" but that is not found

Simply looking at the module leads to undefined:

console.log("Pond:",JSON.stringify(TimeSeries));

What am I doing wrong here?

Thank you.


Solution

  • The problem appears to be related to using the latest version of pond which was developed in TypeScript.

    The previous version (pondjs 0.8.9) has no problems executing under node.js using JavaScript following the steps above.

    Documentation: https://esnet-pondjs.appspot.com/#/