Skip to content
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

Remove CommonJS entry point #2361

Merged
merged 1 commit into from
Feb 17, 2025
Merged

Remove CommonJS entry point #2361

merged 1 commit into from
Feb 17, 2025

Conversation

Borewit
Copy link
Owner

@Borewit Borewit commented Feb 17, 2025

loadMusicMetadata() no longer available.
load-esm can be used instead.

Replace

import {loadMusicMetadata} from 'music-metadata';

(async () => {
  const mm = await loadMusicMetadata();
})();

with:

npm install load-esm
import {loadEsm} from 'load-esm';

(async () => {
  const mm = await loadEsm<typeof import('music-metadata')>('music-metadata');
})();

Benefits:

  • One generic shared solution which works for importing any pure ESM project
  • Avoid CommonJS and ESM typings getting mixed up

@Borewit Borewit added the API change Breaking change in API label Feb 17, 2025
@Borewit Borewit self-assigned this Feb 17, 2025
`loadMusicMetadata()` no longer available. `load-esm` can be used instead.
@Borewit Borewit force-pushed the remove-cjs-entry-point branch from f88c5df to c7688d7 Compare February 17, 2025 15:28
@coveralls
Copy link

coveralls commented Feb 17, 2025

Coverage Status

coverage: 97.002% (-0.003%) from 97.005%
when pulling c7688d7 on remove-cjs-entry-point
into ac4119c on master.

@Borewit Borewit merged commit ad6ac15 into master Feb 17, 2025
27 checks passed
@Borewit Borewit deleted the remove-cjs-entry-point branch February 17, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change Breaking change in API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants