GraphicsMagick wrapper for node.js
In fact, lygrafmajik is simple (not as the name I choose).
It's just a simple wrapper to the CLI of GraphicsMagick for Node.js.
I think the npm module for GraphicsMagick is really, really great.
But when dealing with big images on large websites, the processing time is way too big.
So I write an handler to deal with the CLI, but without control, without verification. You must use the documentation of GraphicsMagick to know what parameters to give to each methods.
Install the module with:
npm install lygrafmajik
lgm = ;convertsize "100x100";
After including the module and storing to a variable, initiate an lygrafmajik object by calling it :
It accept two parameters :
source path and
lgm = ;myImage = ;
After that, you must precise the GraphicsMagick utility you want to use.
When all is set, you can call the exec method to let the magic happens. The optional callback function get three parameters :
Those are the three parameters of the child_process.exec's node.js command callback.
As each methods of lygrafmajik object returns itself, all the above methods can be chained, jQuery-style :
lgm = ;myImage =convertsize "100x100";
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Copyright (c) 2014 Leny
Licensed under the MIT license.