exiftool2
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Exiftool2

NPM version NPM downloads Build status Test coverage

Wrapper for efficiently working with exiftool.

I'd also recommend using exiftool-vendored!

Installation

npm install exiftool2 --save

Usage

import { exec, open } from "exiftool2";
 
// Pass arguments to create an instance of `exiftool` parsing.
// Default arguments: `-q -json`
// Read more: http://linux.die.net/man/1/exiftool
const exif = exec(["-fast", "placeholder.png"]);
 
// The `exif` result is always an array of exif objects from `exiftool`.
exif.on("exif", data => console.log(data));
exif.on("error", error => console.error(error));
 
// Supports streaming into `exiftool`.
const exif = exec("-fast", "-");
 
// Remember you can close the connection early on exif data.
exif.on("exif", data => console.log(data));
 
// Pipe directly into `exiftool` (E.g. over HTTP).
createReadStream("placeholder.png").pipe(exif);
 
// Create an instance that defaults to `-stay_open`.
// Identical to `exec`, except for the default arguments.
// Default arguments: `-stay_open True -@ -`
const exif = open(["-fast", "placeholder.png"]);
 
// Multiple `exif` events will emit in `open` mode.
exif.on("exif", data => console.log(data));
 
// Push commands to `-execute`. Appends `-q -json` to each `send()` command.
exif.send("placeholder.png");
 
// You also also stream with `-stay_open`.
// Both `send` and `read` return a promise to resolve with exif data.
exif.read(createReadStream("placeholder.png"));
 
// Sends `-stay_open False`, causing `exiftool` to close.
exif.close();

License

Apache 2.0

Package Sidebar

Install

npm i exiftool2

Weekly Downloads

3

Version

1.0.1

License

Apache-2.0

Unpacked Size

23 MB

Total Files

1095

Last publish

Collaborators

  • blakeembrey