Skip to content

feat: switch to ESM-only #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

feat: switch to ESM-only #93

wants to merge 1 commit into from

Conversation

43081j
Copy link

@43081j 43081j commented Apr 16, 2025

Switches to ES modules.

Usages:

// If you're in a CJS project in Node 20 and above
const {default: picocolors} = require('picocolors');

// If you're in an ESM project in any version
import picocolors from 'picocolors';

// If you're in a CJS project before Node 20
const {default: picocolors} = await import('picocolors');

// In a browser, you can use ESM just the same
import picocolors from 'picocolors';

Switches to ES modules.

Usages:

```ts
// If you're in a CJS project in Node 20 and above
const {default: picocolors} = require('picocolors');

// If you're in an ESM project in any version
import picocolors from 'picocolors';

// If you're in a CJS project before Node 20
const {default: picocolors} = await import('picocolors');

// In a browser, you can use ESM just the same
import picocolors from 'picocolors';
```
@43081j 43081j mentioned this pull request Apr 16, 2025
@43081j
Copy link
Author

43081j commented Jun 1, 2025

@alexeyraspopov any thoughts on this?

And rgb support

Those are the last two things people have been asking for. Happy to chat through it here, discord or email. Whatever works, but would be nice to figure it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant