music-metadata-browser
Advanced tools
Comparing version 2.1.3 to 2.1.4
import { IAudioMetadata, IOptions } from 'music-metadata/lib/type'; | ||
import * as mm from 'music-metadata/lib/core'; | ||
export { IPicture, IAudioMetadata, IOptions, ITag, INativeTagDict, IChapter } from 'music-metadata/lib/type'; | ||
export { parseBuffer, parseFromTokenizer, orderTags, ratingToStars, IFileInfo } from 'music-metadata/lib/core'; | ||
export { parseBuffer, parseFromTokenizer, orderTags, ratingToStars, IFileInfo, selectCover } from 'music-metadata/lib/core'; | ||
/** | ||
@@ -6,0 +6,0 @@ * Parse audio Stream |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fetchFromUrl = exports.parseBlob = exports.parseReadableStream = exports.parseNodeStream = exports.ratingToStars = exports.orderTags = exports.parseFromTokenizer = exports.parseBuffer = void 0; | ||
exports.fetchFromUrl = exports.parseBlob = exports.parseReadableStream = exports.parseNodeStream = exports.selectCover = exports.ratingToStars = exports.orderTags = exports.parseFromTokenizer = exports.parseBuffer = void 0; | ||
const initDebug = require("debug"); | ||
@@ -14,2 +14,3 @@ const mm = require("music-metadata/lib/core"); | ||
Object.defineProperty(exports, "ratingToStars", { enumerable: true, get: function () { return core_1.ratingToStars; } }); | ||
Object.defineProperty(exports, "selectCover", { enumerable: true, get: function () { return core_1.selectCover; } }); | ||
/** | ||
@@ -16,0 +17,0 @@ * Parse audio Stream |
{ | ||
"name": "music-metadata-browser", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"description": "Browserifed version of music-metadata", | ||
@@ -85,3 +85,3 @@ "main": "lib/index.js", | ||
"@types/jasmine": "^3.5.14", | ||
"@types/node": "^14.6.4", | ||
"@types/node": "^14.10.0", | ||
"coveralls": "^3.1.0", | ||
@@ -112,3 +112,3 @@ "del-cli": "^3.0.1", | ||
"debug": "^4.0.1", | ||
"music-metadata": "^7.1.0", | ||
"music-metadata": "^7.2.0", | ||
"readable-stream": "^3.6.0", | ||
@@ -115,0 +115,0 @@ "readable-web-to-node-stream": "^2.0.0", |
@@ -227,2 +227,20 @@ [![Build Status](https://travis-ci.org/Borewit/music-metadata-browser.svg?branch=master)](https://travis-ci.org/Borewit/music-metadata-browser) | ||
#### selectCover function | ||
Select cover image based on image type field, otherwise the first picture in file. | ||
```ts | ||
export function selectCover(pictures?: IPicture[]): IPicture | null | ||
``` | ||
```js | ||
import * as mm from 'music-metadata'; | ||
(async () => { | ||
const {common} = await mm.parseFile(filePath); | ||
const cover = mm.selectCover(common.picture); // pick the cover image | ||
} | ||
)(); | ||
``` | ||
### Options | ||
@@ -229,0 +247,0 @@ * `duration`: default: `false`, if set to `true`, it will parse the whole media file if required to determine the duration. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34494
243
302
Updatedmusic-metadata@^7.2.0