New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

music-metadata

Package Overview
Dependencies
Maintainers
1
Versions
270
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

music-metadata - npm Package Compare versions

Comparing version 0.7.5 to 0.7.6

11

lib/common.js

@@ -8,13 +8,2 @@ "use strict";

}
Common.getParserForMediaType = function (types, header) {
for (var _i = 0, types_1 = types; _i < types_1.length; _i++) {
var type = types_1[_i];
var offset = type.offset || 0;
if (header.length >= offset + type.buf.length && header.slice(offset, offset + type.buf.length).compare(type.buf) === 0) {
return type.tag;
}
}
// default to id3v1.1 if we cannot detect any other tags
return require('./id3v1/id3v1');
};
Common.streamOnRealEnd = function (stream, callback) {

@@ -21,0 +10,0 @@ stream.on('end', done);

9

lib/ParserFactory.js

@@ -98,2 +98,4 @@ "use strict";

return es6_promise_1.Promise.resolve(new APEv2Parser_1.APEv2Parser());
case 'audio/aac':
case 'audio/aacp':
case 'audio/mp4':

@@ -107,5 +109,6 @@ return es6_promise_1.Promise.resolve(new MP4Parser_1.MP4Parser());

return es6_promise_1.Promise.resolve(new OggParser_1.OggParser());
case 'audio/aac':
case 'audio/aacp':
return es6_promise_1.Promise.resolve(new MP4Parser_1.MP4Parser());
case 'audio/aiff':
case 'audio/x-aif':
case 'audio/x-aifc':
return es6_promise_1.Promise.resolve(new AiffParser_1.AIFFParser());
default:

@@ -112,0 +115,0 @@ throw new Error("MIME-Type: " + mimeType + " not supported.");

{
"name": "music-metadata",
"description": "Streaming music metadata parser for node and the browser.",
"version": "0.7.5",
"version": "0.7.6",
"author": {

@@ -34,3 +34,4 @@ "name": "Borewit",

"ape",
"MonkeyAudio"
"MonkeyAudio",
"aiff"
],

@@ -57,3 +58,3 @@ "main": "lib",

"is-stream": "^1.1.0",
"strtok3": "^0.2.0",
"strtok3": "^1.0.0",
"then-read-stream": "^0.1.0",

@@ -67,3 +68,3 @@ "token-types": "0.0.1"

"@types/node": "^8.0.6",
"chai": "^4.0.2",
"chai": "^4.1.0",
"mocha": "^3.4.2",

@@ -70,0 +71,0 @@ "npm-run-all": "^3.1.1",

@@ -1,2 +0,5 @@

[![Build Status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![npm downloads][npm-downloads-image]][npm-url]
[![Build Status](https://travis-ci.org/Borewit/music-metadata.svg?branch=master)](https://travis-ci.org/Borewit/music-metadata)
[![NPM version](https://badge.fury.io/js/music-metadata.svg)](https://npmjs.org/package/music-metadata)
[![npm downloads](http://img.shields.io/npm/dm/music-metadata.svg)](https://npmjs.org/package/music-metadata)
[![Dependencies](https://david-dm.org/Borewit/music-metadata.svg)](https://david-dm.org/Borewit/music-metadata)

@@ -41,3 +44,3 @@ Streaming music metadata parser for node.

#### JavaScript
##### JavaScript
```javascript

@@ -47,3 +50,3 @@ var mm = require('music-metadata');

mm.parseFile('../test/samples/MusicBrainz-multiartist [id3v2.4].V2.mp3')
mm.parseFile('../test/samples/MusicBrainz-multiartist [id3v2.4].V2.mp3', {native: true})
.then(function (metadata) {

@@ -53,7 +56,7 @@ console.log(util.inspect(metadata, { showHidden: false, depth: null }));

.catch(function (err) {
console.err(err.message);
console.error(err.message);
});
```
#### TypeScript
##### TypeScript
```TypeScript

@@ -72,129 +75,2 @@ import * as mm from 'music-metadata';

This will output the following music metadata:
```javascript
{
common:
{
artists: [ 'Beth Hart', 'Joe Bonamassa' ],
track: { no: 1, of: 10 },
disk: { no: 1, of: 1 },
title: 'Sinner\'s Prayer',
artist: 'Beth Hart & Joe Bonamassa',
album: 'Don\'t Explain',
year: 2011,
date: '2011-09-27',
picture:
[ { format: 'jpg',
data: <Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ff db 00 43 00 03 02 02 03 02 02 03 03 03 03 04 03 03 04 05 08 05 05 04 04 05 0a 07 07 06 ... > } ],
originaldate: '2011-09-26',
media: 'CD',
albumartist: 'Beth Hart & Joe Bonamassa',
label: 'J&R Adventures',
albumartistsort: 'Hart, Beth & Bonamassa, Joe',
artistsort: 'Hart, Beth & Bonamassa, Joe',
asin: 'B004X5SCGM',
barcode: '804879313915',
catalognumber: 'PRAR931391',
musicbrainz_albumartistid:
[ '3fe817fc-966e-4ece-b00a-76be43e7e73c',
'984f8239-8fe1-4683-9c54-10ffb14439e9' ],
musicbrainz_albumid: 'e7050302-74e6-42e4-aba0-09efd5d431d8',
releasestatus: 'official',
releasetype: [ 'album' ],
musicbrainz_artistid:
[ '3fe817fc-966e-4ece-b00a-76be43e7e73c',
'984f8239-8fe1-4683-9c54-10ffb14439e9' ],
musicbrainz_releasegroupid: 'e00305af-1c72-469b-9a7c-6dc665ca9adc',
musicbrainz_trackid: 'd062f484-253c-374b-85f7-89aab45551c7',
script: 'Latn',
originalyear: 2011,
musicbrainz_recordingid: 'f151cb94-c909-46a8-ad99-fb77391abfb8' },
format:
{ duration: 2,
headerType: 'id3v2.4',
dataformat: 'mp3',
lossless: false,
bitrate: 128000,
sampleRate: 44100,
numberOfChannels: 2,
encoder: 'LAME3.99r',
codecProfile: 'V2' },
'id3v2.4':
{ TIT2: 'Sinner\'s Prayer',
TPE1: 'Beth Hart & Joe Bonamassa',
TRCK: '1/10',
TALB: 'Don\'t Explain',
TPOS: '1/1',
TDRC: '2011-09-27',
APIC:
[ { format: 'image/jpeg',
type: 'Cover (front)',
description: '',
data: <Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ff db 00 43 00 03 02 02 03 02 02 03 03 03 03 04 03 03 04 05 08 05 05 04 04 05 0a 07 07 06 ... > } ],
TDOR: '2011-09-26',
TIPL:
{ producer: [ 'Roy Weisman' ],
engineer: [ 'James McCullagh', 'Jared Kvitka' ],
arranger: [ 'Jeff Bova' ] },
TMCL:
{ 'bass guitar': [ 'Carmine Rojas' ],
orchestra: [ 'The Bovaland Orchestra' ],
drums: [ 'Anton Fig' ],
percussion: [ 'Anton Fig' ],
guitar: [ 'Blondie Chaplin', 'Joe Bonamassa' ],
keyboard: [ 'Arlan Scheirbaum' ],
vocals: [ 'Beth Hart', 'Joe Bonamassa' ],
piano: [ 'Beth Hart' ] },
TMED: 'CD',
TPE2: 'Beth Hart & Joe Bonamassa',
TPUB: 'J&R Adventures',
TSO2: 'Hart, Beth & Bonamassa, Joe',
TSOP: 'Hart, Beth & Bonamassa, Joe',
'TXXX:ACOUSTID_ID': [ '09c06fac-679a-45b1-8ea0-6ce532318363' ],
'TXXX:ARRANGER': [ 'Jeff Bova' ],
'TXXX:ARTISTS': [ 'Joe Bonamassa' ],
'TXXX:ARTISTSORT': [ 'Hart, Beth & Bonamassa, Joe' ],
'TXXX:ASIN': 'B004X5SCGM',
'TXXX:Artists': [ 'Beth Hart', 'Joe Bonamassa' ],
'TXXX:BARCODE': '804879313915',
'TXXX:Band': [ 'Beth Hart & Joe Bonamassa' ],
'TXXX:CATALOGNUMBER': 'PRAR931391',
'TXXX:ENGINEER': [ 'Jared Kvitka' ],
'TXXX:LABEL': [ 'J&R Adventures' ],
'TXXX:MEDIA': [ 'CD' ],
'TXXX:MUSICBRAINZ_ALBUMARTISTID': [ '984f8239-8fe1-4683-9c54-10ffb14439e9' ],
'TXXX:MUSICBRAINZ_ALBUMID': [ 'e7050302-74e6-42e4-aba0-09efd5d431d8' ],
'TXXX:MUSICBRAINZ_ARTISTID': [ '984f8239-8fe1-4683-9c54-10ffb14439e9' ],
'TXXX:MUSICBRAINZ_RELEASEGROUPID': [ 'e00305af-1c72-469b-9a7c-6dc665ca9adc' ],
'TXXX:MUSICBRAINZ_RELEASETRACKID': [ 'd062f484-253c-374b-85f7-89aab45551c7' ],
'TXXX:MUSICBRAINZ_TRACKID': [ 'f151cb94-c909-46a8-ad99-fb77391abfb8' ],
'TXXX:MusicBrainz Album Artist Id':
[ '3fe817fc-966e-4ece-b00a-76be43e7e73c',
'984f8239-8fe1-4683-9c54-10ffb14439e9' ],
'TXXX:MusicBrainz Album Id': 'e7050302-74e6-42e4-aba0-09efd5d431d8',
'TXXX:MusicBrainz Album Status': 'official',
'TXXX:MusicBrainz Album Type': [ 'album' ],
'TXXX:MusicBrainz Artist Id':
[ '3fe817fc-966e-4ece-b00a-76be43e7e73c',
'984f8239-8fe1-4683-9c54-10ffb14439e9' ],
'TXXX:MusicBrainz Release Group Id': 'e00305af-1c72-469b-9a7c-6dc665ca9adc',
'TXXX:MusicBrainz Release Track Id': 'd062f484-253c-374b-85f7-89aab45551c7',
'TXXX:NOTES': [ 'Medieval CUE Splitter (www.medieval.it)' ],
'TXXX:ORIGINALDATE': [ '2011-09-26' ],
'TXXX:ORIGINALYEAR': [ '2011' ],
'TXXX:PERFORMER': [ 'Beth Hart (piano)' ],
'TXXX:PRODUCER': [ 'Roy Weisman' ],
'TXXX:Part of a set': [ '1/1' ],
'TXXX:RELEASECOUNTRY': [ 'GB' ],
'TXXX:RELEASESTATUS': [ 'official' ],
'TXXX:RELEASETYPE': [ 'album' ],
'TXXX:SCRIPT': 'Latn',
'TXXX:originalyear': '2011',
UFID:
[ { owner_identifier: 'http://musicbrainz.org',
identifier: <Buffer 66 31 35 31 63 62 39 34 2d 63 39 30 39 2d 34 36 61 38 2d 61 64 39 39 2d 66 62 37 37 33 39 31 61 62 66 62 38> } ] } }
```
Although in most cases duration is included, in some cases it requires `music-metadata` parsing the entire file.

@@ -208,4 +84,5 @@ To enforce parsing the entire file if needed you should set `duration` to `true`.

```
For a live example see [_Parse MP3 (ID3v2.4 tags) stream with music-metadata_](https://runkit.com/borewit/parse-mp3-id3v2-4-tags-stream-with-music-metadata), hosted on RunKit.
Note that in order to read the duration for streams that are not file streams, in some cases you should pass the size of the file in bytes.
In order to read the duration of a stream (with the exception of file streams), in some cases you should pass the size of the file in bytes.
```javascript

@@ -221,9 +98,6 @@ mm.parseStream(someReadStream, 'audio/mpeg', { duration: true, fileSize: 26838 })

-----------------
(The MIT License)
Copyright (c) 2016 Borewit
Copyright (c) 2017 Borewit
Based on [musicmetadata] (https://github.com/leetreveil/musicmetadata/) written by Lee Treveil <leetreveil@gmail.com> and many others.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@@ -235,7 +109,2 @@

[npm-url]: https://npmjs.org/package/music-metadata
[npm-image]: https://badge.fury.io/js/music-metadata.svg
[npm-downloads-image]: http://img.shields.io/npm/dm/music-metadata.svg
[travis-url]: https://travis-ci.org/Borewit/music-metadata
[travis-image]: https://travis-ci.org/Borewit/music-metadata.svg?branch=master

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc