1.0.0 • Published 4 years ago

metalsmith-exiftool v1.0.0

Weekly downloads
-
License
AGPLv3
Repository
github
Last release
4 years ago

metalsmith-exiftool

A metalsmith plugin for removing metadata from files using Exiftool.

This plugin removes metadata from files using the Exiftool program. If Exiftool is not installed and available on the $PATH, no metadata will be removed using this plugin.

Installation

npm install metalsmith-exiftool

Usage

To use this plugin, simply add it to the existing plugins in your Metalsmith source file or include it in the Metalsmith JSON file:

JavaScript

const Metalsmith = require('metalsmith');
const exiftool = require('metalsmith-exiftool');

Metalsmith(__dirname)
  .use(exiftool())
  .build((err, files) => {
    if (err) { throw err; }
  });

JSON

{
  "plugins": {
    "exiftool": {}
  }
}

Options

You can pass options to metalsmith-exiftool with the Javascript API or CLI. The options are:

  • pattern: optional. Only files that match this pattern will be processed. Accepts a string or an array of strings. The default is all of the files types that are supported by Exiftool's read and write capabilities.

pattern

Only files that match this pattern will be processed. So this Metalsmith JavaScript configuration or metalsmith.json:

JavaScript

const Metalsmith = require('metalsmith');
const exiftool = require('metalsmith-exiftool');

Metalsmith(__dirname)
  .use(exiftool({
    pattern: 'blog/**/*.html',
  }))
  .build((err, files) => {
    if (err) { throw err; }
  });

JSON

{
  "source": "src",
  "destination": "build",
  "plugins": {
    "metalsmith-exiftool": {
      "pattern": "blog/**/*.html"
    }
  }
}

Would only remove metadata from HTML files within the ./src/blog folder, because the pattern is relative to your source folder. See multimatch for further details.

License

AGPLv3

1.0.0

4 years ago