metadata-extract
v2.0.2
Published
Extract metadata from media files, with pluggable add-ons.
Downloads
886
Readme
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 theextractors
directory of this module, or promise-returning functions of the form:async function (data, input) { return metadata }
input
is existing metadata found by other extractors.input.mimetype
will contain the mime-type if detected.metadata
must 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 fromepub
files