UNPKG

check-esm

Version:

The module has JS functions to check all imports or required modules and check if the file is a ES Module or a CJS/ JS Module or Script

4 lines (3 loc) 120 B
const checkEsm = require("../index.js"); let isesm = checkEsm._isESCode("./demos/isESCode.cjs"); console.log(isesm);