How to use the node-id3.read function in node-id3

To help you get started, we’ve selected a few node-id3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Kefir100 / radio-ch1ller / src / sound / methods / sound.ts View on Github external
const getMeta = ({ fullPath, name }: TrackStats): ShallowTrackMeta => {
  try {
    const { artist, title, ...rest } = id3.read(fullPath);
    if (!artist || !title) {
      throw new Error('id3 tags dont have enough data');
    }
    return { artist, title, ...rest, origin: 'id3' };
  }
  catch (e) {
    const [artist, title] = name.split(' - ');
    return { artist, title, origin: 'fs' };
  }
};

node-id3

Pure JavaScript ID3v2 Tag writer and reader

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis