StratoDem / pandas-js

Pandas in JavaScript for data analysis and visualization
https://stratodem.github.io/pandas.js-docs
MIT License
458 stars 36 forks source link

SyntaxError when importing pandas-js #62

Closed renatocfrancisco closed 2 years ago

renatocfrancisco commented 2 years ago

I installed pandas-js. Why is it not working?

import { Series, DataFrame } from 'pandas-js';

const df = new DataFrame([{x: 1, y: 2}, {x: 2, y: 3}, {x: 3, y: 4}])

df.toString();
SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1032:15)
    at Module._compile (node:internal/modules/cjs/loader:1067:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47