(async() => { const gifFrames = require('gif-frames'); const fs = require('fs'); const path = require('path'); const gifPath = process.argv[2]; if(!gifPath) { console.log('Please provide an gif file as an argument'); process.exit(1); } const gifAbsPath = path.resolve(gifPath); if(!fs.existsSync(gifAbsPath)) { console.log('The provided gif file does not exists'); process.exit(1); } gifFrames({ url: gifAbsPath, frames: 'all', outputType: 'png', cumulative: true }) .then(function (frameData) { if (frameData.length > 1) { console.log('This GIF is animated.'); } else { console.log('This GIF is not animated.'); } }) .catch(function (err) { console.error('An error occurred: ', err); }); })()