Created
April 23, 2014 15:34
-
-
Save cyrilis/11220177 to your computer and use it in GitHub Desktop.
KindleGen_wrapper in node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# KindleGen | |
child_process = require 'child_process' | |
cmd = child_process.exec | |
module.exports = (options)-> | |
new KindleGen | |
KindleGen = (options)-> | |
@source = options.source; | |
@target = options.target; | |
@kindlegenDir = __dirname + '/KindleGen/kindlegen_'+process.platform | |
kindlegenCmd = @kindlegenDir + " " + @source + ' -o '+ @target | |
mobi = cmd kindlegenCmd, (err,stdout,stderr)-> | |
if err and options.error | |
options.error err | |
if options.success | |
options.success stdout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment