Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223
  1. // When on node 14, it validates that all of the commonjs exports
  2. // are correctly re-exported for es modules importers.
  3. const nodeMajor = Number(process.version.split(".")[0].slice(1))
  4. if (nodeMajor < 14) {
  5. console.log("Skipping because node does not support module exports.")
  6. process.exit(0)
  7. }
  8. // ES Modules import via the ./modules folder
  9. import * as esTSLib from "../../modules/index.js"
  10. // Force a commonjs resolve
  11. import { createRequire } from "module";
  12. const commonJSTSLib = createRequire(import.meta.url)("../../tslib.js");
  13. for (const key in commonJSTSLib) {
  14. if (commonJSTSLib.hasOwnProperty(key)) {
  15. if(!esTSLib[key]) throw new Error(`ESModules is missing ${key} - it needs to be re-exported in ./modules/index.js`)
  16. }
  17. }
  18. console.log("All exports in commonjs are available for es module consumers.")