gajus / gajus/extract-date

Import compatibility with ES modules in 2025

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
51
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Thanks for this library! I had some trouble using this with ES modules. So I wanted to share how I was able to import it and use it for others.

The default import object as it's currently implemented: `import extractDate from 'extract-date';`

Seems to have nested defaults:

```
[Object: null prototype] {
__esModule: true,
default: { default: [Function: _default] }
```

So my fix:
```
import * as ed from 'extract-date';
const extractDate = ed.default.default;
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.