Skip to content

Add frame replacement and removal options - #191

Open
26fe wants to merge 1 commit into
Zazama:0.2from
26fe:feature/frame-replacement-removal
Open

Add frame replacement and removal options#191
26fe wants to merge 1 commit into
Zazama:0.2from
26fe:feature/frame-replacement-removal

Conversation

@26fe

@26fe 26fe commented Jul 17, 2026

Copy link
Copy Markdown

Summary

Adds explicit controls for replacing or removing complete ID3 frame types during NodeID3.update().

This is useful for multiple-value frames such as SYLT, where the existing update behavior appends new values and does not provide a way to replace all existing instances. Calls that omit the new options retain the existing merge behavior.

Changes

  • Add replaceFrames and removeFrames update options to NodeID3.update()
  • Apply the same behavior to buffer, filepath, callback, synchronous, and promise update APIs.
  • Add TypeScript declarations through UpdateOptions.
  • Document merge, replacement, and removal behavior in the README.
  • Add generated-buffer and disposable-file tests.

Examples

Replace every existing SYLT frame with the supplied synchronized lyrics:

NodeID3.update(
    {
        synchronisedLyrics: [newLyrics]
    },
    fileOrBuffer,
    {
        replaceFrames: ['SYLT']
    }
)

Remove every existing SYLT frame:

NodeID3.update(
    {},
    fileOrBuffer,
    {
        removeFrames: ['SYLT']
    }
)

Tests

  • npm test — 81 passing
  • npm run eslint — passing

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