The way of importing the library has changed in this v3 in order to make it compatible with ES6 and Typescript. The changes are:
Before:
<script src="lib/easytimer/dist/easytimer.min.js"></script>
<script>
var timerInstance = new Timer();
</script>
Now:
<script src="lib/easytimer/dist/easytimer.min.js"></script>
<script>
var timerInstance = new easytimer.Timer();
</script>
Before:
var Timer = require('easytimer.js');
var timerInstance = new Timer();
Now:
var Timer = require('easytimer.js').Timer;
var timerInstance = new Timer();
// or
var { Timer } = require('easytimer.js');
var timerInstance = new Timer();
require(['node_modules/easytimer.js/dist/easytimer.min.js'], function (Timer) {
var timer = new Timer();
});
Now:
require(['node_modules/easytimer.js/dist/easytimer.min.js'], function (easytimer) {
var timer = new easytimer.Timer();
});
// or
require(['node_modules/easytimer.js/dist/easytimer.min.js'], function ({ Timer }) {
var timer = new Timer();
});