2.0.2 • Published 5 years ago
metadata-extract v2.0.2
metadata-extract
Extract metadata from various types of media file using 'pluggable' extractors.
API
const extract = require('metadata-extract')
const metadata = await extract(sourceFilename, options)options is an optional object which may include:
options.extractors- An array of extractors to use. These should be either filenames of the extractors included in theextractorsdirectory of this module, or promise-returning functions of the form:async function (data, input) { return metadata }inputis existing metadata found by other extractors.input.mimetypewill contain the mime-type if detected.metadatamust be an object containing the metadata found, or undefined if nothing was extracted.
options.log- A logger function (defaults to debug)options.allowBuffers- If true, buffers will be allowed in
metadata is an object containing the metadata found.
Included extractors
extractors/music-metadata- Extract music-metdataextractors/exif-tool- Extract using exiftool - requires exiftool to be installed as an external dependency. Disabled by default.extractors/image-size- Get the size of images using image-sizeextractors/pdf-text- extracts text from PDFs using pdf2jsonextractors/text- extracts the beginning of text filesextractors/zip- extracts directory listing from zip filesextractors/epub- extracts text preview or contents listing fromepubfiles