I'm totally new to JS and I'm trying to use [Cropper.js](https://github.com/fengyuanchen/cropperjs). I couldn't run the given example on README either. This is the code that I'm trying to run:

```js
//import Cropper from 'cropperjs';

let image = document.getElementById('img');
const cropper = new Cropper(image, {
  aspectRatio: 16 / 9,
  crop(event) {
    console.log(event.detail.x);
    console.log(event.detail.y);
    console.log(event.detail.width);
    console.log(event.detail.height);
    console.log(event.detail.rotate);
    console.log(event.detail.scaleX);
    console.log(event.detail.scaleY);
  },
});
```

```css
img {

    display: block;
    max-width: 100%;
}
```

```html
<!DOCTYPE html>
<html>
    <head>
        <title>Cropper Test</title>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.6/cropper.css"/>
        <link rel="stylesheet" href="style.css"/>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.6/cropper.js"></script>
        <script type="text/javascript" src="test.js"></script>
    </head>
    <body>
        <div>
            <img id="img" src="test.png"/>
        </div>
    </body>
</html>
```

If I uncomment the import statement, in console it shows : Cannot use import statement outside a module.
I did search here for this problem but couldn't find anything that fixes my problem.