Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including exiftool-kit with all npm packages installed. Try it out:

var exiftoolKit = require("exiftool-kit")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

exiftool-kit v0.1.6

This is a ExifTool node.js wrapped version. Help you can read / write / create exif, iptc and more information of media

Exiftool-kit

This is a package is exiftool nodejs wrapped version. With this wrapped version, you can read / create / edit / remove image exif / iptc settings very easy.

This package don't depend on any other npm packages, and you may also set your own exiftool binary file as you wish.

installation

$ npm install --save exiftool-kit

how to use

set your own exiftool (not necessary, unless you really wanna set your own exiftool binary)

const ExifTool = require('exiftool-kit')
const exiftool = new ExifTool(pathToYourOwnExifTool)

or

const ExifTool = require('exiftool-kit')
const exiftool = new ExifTool()

exiftool.setBin(pathToYourOwnExifTool)

read tags

read a single file

const ExifTool = require('exiftool-kit')
const exiftool = new ExifTool()

exiftool.getTag({
    source: file
})

read files

const ExifTool = require('exiftool-kit')
const exiftool = new ExifTool()

exiftool.getTag({
    source: [file1, file2]
})

read buffer

const ExifTool = require('exiftool-kit')
const exiftool = new ExifTool()

exiftool.getTag({
    source: buffer
})

edit (write | update | remove) tags

write / update tags

const ExifTool = require('exiftool-kit')
const exiftool = new ExifTool()

exiftool.setTags({
    source: image,
    tags: [
        { tag: 'iptc:By-line', value: 'Kim Hsiao' }
    ]
})

remove tags

const ExifTool = require('exiftool-kit')
const exiftool = new ExifTool()

exiftool.setTags({
    source: imageBuffer,
    tags: [
        { tag: 'Model', value: '' }
    ]
})

remove all tags

const ExifTool = require('exiftool-kit')
const exiftool = new ExifTool()

exiftool.setTags({
    source: imageBuffer,
    tags: [
        { tag: 'all', value: '' }
    ]
})

example

You may check example, to get more detail example code

Note

When you edit tags to a file, this will return the given file name. If you edit tags from a buffer, it will return a updated buffer.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free