NickNaso / ghostscript4js

Ghostscript4JS binds the Ghostscript C API to the Node.JS world.
http://www.nacios.it
Apache License 2.0
66 stars 19 forks source link

Create execute method #9

Closed NickNaso closed 7 years ago

NickNaso commented 7 years ago

Create the execute method that has the responsability to parse and execute the ghostscript command in asynchrnous way.

function execute(GhostscriptCommend, callback) {}

It's necessary to implement the Javascript and C++ binding for the method.

Use Nan:ThrowError to dispatch errors.

NickNaso commented 7 years ago

For implementation see at these resources: https://github.com/nodejs/nan/tree/master/examples/async_pi_estimate https://nodejs.org/dist/latest-v7.x/docs/api/addons.html#addons_callbacks https://github.com/nodejs/node-addon-examples/blob/master/3_callbacks/nan/addon.cc https://github.com/fcanas/node-native-boilerplate/blob/master/functions.cc

NickNaso commented 7 years ago

Async method implemented with Nan support to be compatible with all Node.JS version after v0.12.