···2626A submodule of this package can also be imported:
27272828```js
2929-import { Hex } from '@lapo/asn1js/hex';
2929+import { Hex } from '@lapo/asn1js/hex.js';
3030+```
3131+3232+Once [`require(esm)` gets released](https://joyeecheung.github.io/blog/2024/03/18/require-esm-in-node-js/) (probably in Node 22) it will be possible to `require` it normally:
3333+3434+```js
3535+const ASN1 = require('@lapo/asn1js');
3636+const Hex = require('@lapo/asn1js/hex.js');
3737+console.log(ASN1.decode(Hex.decode('06032B6570')).content());
3038```
31393232-Unfortunately until [`require(esm)` gets released](https://joyeecheung.github.io/blog/2024/03/18/require-esm-in-node-js/) it is necessary to use async `import()` when used from CommonJS (legacy NodeJS) code.
4040+Until then, it is necessary to use async `import()` when used from CommonJS (legacy NodeJS) code:
4141+4242+```js
4343+async function main() {
4444+ const { ASN1 } = await import('@lapo/asn1js');
4545+ const { Hex } = await import('@lapo/asn1js/hex.js');
4646+ console.log(ASN1.decode(Hex.decode('06032B6570')).content());
4747+}
4848+main();
4949+```
33503451Usage on the web
3552--------------------