Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js GraphicsMagic: check installation & functionality

I am working with the Node.js module gm (Github) for GraphicsMagic (Link).

How can I determine whether the required GraphicsMagic software for the gm module is installed & fully functional on the current node.js machine or not? (I want to check this on the initialization process of my server)

like image 599
RienNeVaPlu͢s Avatar asked Mar 24 '23 16:03

RienNeVaPlu͢s


1 Answers

You can call the command line tool and check the output.

var exec = require('child_process').exec;

exec("gm", function (error, stdout, stderr) {
  // Validate the output with one of the parameters.
});
like image 98
Jean-Philippe Leclerc Avatar answered Apr 08 '23 23:04

Jean-Philippe Leclerc