Test

ES Module

Using Test.js as ES6 Module in HTML

Note: this is browser side, not in Terminal.

Import in html directly

<script type="module">
  import Test from "../node_modules/@jlongyam/test/dist/Test.min.mjs";

  const { describe, it, assert } = Test();
</script>

Import in html using importmap

<script type="importmap">
  {
    "imports": {
      "Test": "../node_modules/@jlongyam/test/dist/Test.min.mjs"
    }
  }
</script>

<script type="module">
  import Test from "Test";

  const { describe, it, assert } = Test();
</script>

Import external script module

<script type="module" src="./test.js"></script>
import Test from "../node_modules/@jlongyam/test/dist/Test.min.mjs";

const { describe, it, assert } = Test();

Import external script module using importmap

In HTML

<script type="importmap">
  {
    "imports": {
      "Test": "../node_modules/@jlongyam/test/dist/Test.min.mjs"
    }
  }
</script>
<script type="module" src="./test.js"></script>

Then in test.js

import Test from 'Test';

const { describe, it, assert } = Test();

See also: CDN