Skip to content

Commit

Permalink
Remove CommonJS entry point
Browse files Browse the repository at this point in the history
`loadMusicMetadata()` no longer available. `load-esm` can be used instead.
  • Loading branch information
Borewit committed Feb 17, 2025
1 parent 47c00a5 commit ad6ac15
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 20 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ For older Node.js version < 22, you need to dynamically import **music-metadata*

For CommonJS TypeScript projects, using a Node.js version < 22, you can use [load-esm](https://github.com/Borewit/load-esm):

This method shall replace the embedded CJS loader `loadMusicMetadata()` function.
This method shall has replaced the embedded CJS loader function: `loadMusicMetadata()`.

```js
import {loadEsm} from 'load-esm';
Expand All @@ -797,9 +797,6 @@ import {loadEsm} from 'load-esm';
})();
```

> [!NOTE]
> The `loadMusicMetadata` function is experimental.
## Frequently Asked Questions

### How can I traverse (a long) list of files?
Expand Down
2 changes: 0 additions & 2 deletions lib/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,3 @@ export async function scanAppendingHeaders(tokenizer: IRandomAccessTokenizer, op

options.apeHeader = await APEv2Parser.findApeFooterOffset(tokenizer, apeOffset);
}

export declare function loadMusicMetadata(): Promise<typeof import('music-metadata')>;
5 changes: 0 additions & 5 deletions lib/default.cjs

This file was deleted.

5 changes: 0 additions & 5 deletions lib/node.cjs

This file was deleted.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,18 @@
"node": {
"import": "./lib/index.js",
"module-sync": "./lib/index.js",
"require": "./lib/node.cjs",
"types": "./lib/index.d.ts"
},
"default": {
"import": "./lib/core.js",
"module-sync": "./lib/core.js",
"require": "./lib/default.cjs",
"types": "./lib/core.d.ts"
}
},
"types": "lib/index.d.ts",
"files": [
"lib/**/*.js",
"lib/**/*.d.ts",
"lib/*.cjs"
"lib/**/*.d.ts"
],
"keywords": [
"music",
Expand Down

0 comments on commit ad6ac15

Please sign in to comment.