{"_id":"node-pandoc","_rev":"10-f9d61e59bc0a18d20a64dbc80bf08487","name":"node-pandoc","description":"Interact with Pandoc from NodeJS. *Requires Pandoc to be installed.","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"node-pandoc","version":"0.1.0","description":"Interacti with Pandoc from NodeJS. *Requires Pandoc to be installed.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/eshinn/node-pandoc.git"},"keywords":["pandoc","node","docx","markdown"],"author":{"name":"Eric Shinn","email":"eric.shinn@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/eshinn/node-pandoc/issues"},"homepage":"https://github.com/eshinn/node-pandoc#readme","gitHead":"0262fded124efea1ea37637e7eb4393b408638d6","_id":"node-pandoc@0.1.0","_shasum":"2d61953dbb1579327f3525839efd2a21e157d9c2","_from":".","_npmVersion":"3.5.3","_nodeVersion":"4.2.4","_npmUser":{"name":"eshinn","email":"eric@eric.cx"},"dist":{"shasum":"2d61953dbb1579327f3525839efd2a21e157d9c2","tarball":"https://registry.npmjs.org/node-pandoc/-/node-pandoc-0.1.0.tgz","integrity":"sha512-llSOImvHyWCdq4DKHX/FACRPpkslYhPelbQ1jppKia9/dDsMKmzsPG6KF8qYUyGdB1WaBZtgQLFUL4ip7nas/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF/mx+QBn+2YiYArtBhZcCwxklJWPkK782VLg5ctSHquAiEAmSavkMQlad0roLdWLHJtv+Cw632UQw2fQJvZLW29Cus="}]},"maintainers":[{"name":"eshinn","email":"eric@eric.cx"}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/node-pandoc-0.1.0.tgz_1454546119863_0.09062647260725498"},"directories":{}},"0.1.1":{"name":"node-pandoc","version":"0.1.1","description":"Interact with Pandoc from NodeJS. *Requires Pandoc to be installed.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/eshinn/node-pandoc.git"},"keywords":["pandoc","node","docx","markdown"],"author":{"name":"Eric Shinn","email":"eric.shinn@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/eshinn/node-pandoc/issues"},"homepage":"https://github.com/eshinn/node-pandoc#readme","gitHead":"e3075036fc604ca9fd03e8060a6a0c2a6a7d36ed","_id":"node-pandoc@0.1.1","_shasum":"ed6902554adabc9e5be1f5a124577d70afb4fe1e","_from":".","_npmVersion":"3.5.3","_nodeVersion":"4.2.4","_npmUser":{"name":"eshinn","email":"eric@eric.cx"},"dist":{"shasum":"ed6902554adabc9e5be1f5a124577d70afb4fe1e","tarball":"https://registry.npmjs.org/node-pandoc/-/node-pandoc-0.1.1.tgz","integrity":"sha512-LZzLhEB+P2Hd3GDT7jAZkAbL9Z2xK5mIfHF41/ewCNubcV/pgB+yt5hVl9ytZtZewJMhdj4kLWaonPN6pwnynw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmuV8USHRlxREdtCaAB4XGR2c4RUOuMGlC2sdu0nGnmQIgaTZHZ0Bym4VVcPcmOf3BMq+ZWtfuDh+1RvHkBg89CVU="}]},"maintainers":[{"name":"eshinn","email":"eric@eric.cx"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/node-pandoc-0.1.1.tgz_1454546521926_0.46557250851765275"},"directories":{}},"0.2.0":{"name":"node-pandoc","version":"0.2.0","description":"Interact with Pandoc from NodeJS. *Requires Pandoc to be installed.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/eshinn/node-pandoc.git"},"keywords":["pandoc","node","docx","markdown"],"author":{"name":"Eric Shinn","email":"eric.shinn@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/eshinn/node-pandoc/issues"},"homepage":"https://github.com/eshinn/node-pandoc#readme","gitHead":"120f3b041de72681b547886b130e7749da1b7754","_id":"node-pandoc@0.2.0","_shasum":"270337bd3c7729806464c1f9d424ccbb88fdebbf","_from":".","_npmVersion":"3.5.3","_nodeVersion":"4.2.4","_npmUser":{"name":"eshinn","email":"eric@eric.cx"},"dist":{"shasum":"270337bd3c7729806464c1f9d424ccbb88fdebbf","tarball":"https://registry.npmjs.org/node-pandoc/-/node-pandoc-0.2.0.tgz","integrity":"sha512-58N9OHbeD0yn8/zs916492AxURpAcBm1ajrZnUcQbii5tjrIizQeAZETy5xzdJFIkLmyv2kxmJqUOrG++cLD4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICKUKbWPbd6Pp0FsYHpmYsgPdvEa/sUlxRnVDij3JcNNAiAm7ym46VQSIhNoxYG9jvN4NqoAELqg2UzJ+xBOaMwxow=="}]},"maintainers":[{"name":"eshinn","email":"eric@eric.cx"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/node-pandoc-0.2.0.tgz_1454707112828_0.19958905689418316"},"directories":{}},"0.3.0":{"name":"node-pandoc","version":"0.3.0","description":"Interact with Pandoc from NodeJS. *Requires Pandoc to be installed.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/eshinn/node-pandoc.git"},"keywords":["pandoc","node","docx","markdown"],"author":{"name":"Eric Shinn","email":"eric.shinn@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/eshinn/node-pandoc/issues"},"homepage":"https://github.com/eshinn/node-pandoc#readme","gitHead":"46eb7c9a2b1aff5eae44cafd0f200b9ada6d20ff","_id":"node-pandoc@0.3.0","_shasum":"d46577cd0a72af415353fcb8a0117adb6242f9c8","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"eshinn","email":"eric.shinn@gmail.com"},"dist":{"shasum":"d46577cd0a72af415353fcb8a0117adb6242f9c8","tarball":"https://registry.npmjs.org/node-pandoc/-/node-pandoc-0.3.0.tgz","integrity":"sha512-e+kANHQQFBlN7J8wEFf7sNc1sSCLltyPtPqNA/IEapiNsA1LjZ9mtV/B0lU6b2cAdvn7rrAVNBONw+Fo1YsY+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDkeefDZCG/lwJ+tcxcyl1S2dshp2ebeKRIZyJBE/UbGAiEAqpnJ1fw6+2NqqjufWCmQrOHdEXSeIQdts+eUTkuTK9I="}]},"maintainers":[{"name":"eshinn","email":"eric@eric.cx"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/node-pandoc-0.3.0.tgz_1481808703246_0.8766620699316263"},"directories":{}}},"readme":"# node-pandoc [![npm version](https://badge.fury.io/js/node-pandoc.svg)](https://badge.fury.io/js/node-pandoc) [![SugarHai](https://img.shields.io/badge/farts-sprinkles-E482B5.svg)](http://www.sugarhai.com/images/sprinklepoo-gif.gif)\nRun Pandoc from NodeJS. Pandoc installation is required.\n\n## Install\n\n```sh\n# If using as a dependancy in your module\nnpm install node-pandoc --save\n\n# ...or for use in your project\nnpm install node-pandoc --save-dev\n```\n*Prior to using node-pandoc, you must [install Pandoc](http://pandoc.org/installing.html) by [John MacFarlane](http://johnmacfarlane.net/).*\n\n## What&rsquo;s Pandoc?\n\n> If you need to convert files from one markup format into another, pandoc is your swiss-army knife. Pandoc can convert documents in [markdown](http://daringfireball.net/projects/markdown/), [reStructuredText](http://docutils.sourceforge.net/docs/ref/rst/introduction.html), [textile](http://redcloth.org/textile), [HTML](http://www.w3.org/TR/html40/), [DocBook](http://www.docbook.org/), [LaTeX](http://www.latex-project.org/), [MediaWiki markup](http://www.mediawiki.org/wiki/Help:Formatting), [TWiki markup](http://twiki.org/cgi-bin/view/TWiki/TextFormattingRules), [OPML](http://dev.opml.org/spec2.html), Emacs [Org-Mode](http://orgmode.org/), [Txt2Tags](http://txt2tags.org/), Microsoft Word [docx](http://www.microsoft.com/interop/openup/openxml/default.aspx), LibreOffice [ODT](http://en.wikipedia.org/wiki/OpenDocument), [EPUB](http://en.wikipedia.org/wiki/EPUB), or [Haddock markup](http://www.haskell.org/haddock/doc/html/ch03s08.html) to  \n>\n> * HTML formats: XHTML, HTML5, and HTML slide shows using [Slidy](http://www.w3.org/Talks/Tools/Slidy), [reveal.js](http://lab.hakim.se/reveal-js/), [Slideous](http://goessner.net/articles/slideous/), [S5](http://meyerweb.com/eric/tools/s5/), or [DZSlides](http://paulrouget.com/dzslides/)\n> * Word processor formats: Microsoft Word [docx](http://www.microsoft.com/interop/openup/openxml/default.aspx), OpenOffice/LibreOffice [ODT](http://en.wikipedia.org/wiki/OpenDocument), [OpenDocument XML](http://opendocument.xml.org/)\n> * Ebooks: [EPUB](http://en.wikipedia.org/wiki/EPUB) version 2 or 3, [FictionBook2](http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1)\n> * Documentation formats: [DocBook](http://www.docbook.org/), [GNU TexInfo](http://www.gnu.org/software/texinfo/), [Groff man pages](http://www.gnu.org/software/groff/groff.html), [Haddock markup](http://www.haskell.org/haddock/doc/html/ch03s08.html)\n> * Page layout formats: [InDesign ICML](https://www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf)\n> * Outline formats: [OPML](http://dev.opml.org/spec2.html)\n> * TeX formats: [LaTeX](http://www.latex-project.org/), [ConTeXt](http://www.pragma-ade.nl/), LaTeX Beamer slides\n> * [PDF](http://en.wikipedia.org/wiki/Portable_Document_Format) via LaTeX\n> * Lightweight markup formats: [Markdown](http://daringfireball.net/projects/markdown/) (including [CommonMark](http://commonmark.org/)), [reStructuredText](http://docutils.sourceforge.net/docs/ref/rst/introduction.html), [AsciiDoc](http://www.methods.co.nz/asciidoc/), [MediaWiki markup](http://www.mediawiki.org/wiki/Help:Formatting), [DokuWiki markup](https://www.dokuwiki.org/wiki:syntax), Emacs [Org-Mode](http://orgmode.org/), [Textile](http://redcloth.org/textile)\n> * Custom formats: custom writers can be written in [lua](http://www.lua.org/)\n\n## So Then What&rsquo;s Node-Pandoc Do?\n\nNode-Pandoc is simply a bridge between the Pandoc CLI (command-line interface) and NodeJS.\n\n## Usage\n\n**pandoc ( _src_ _args_ [_options_] _callback_ )**\n\n### Parameters\n\n#### src\n> The _src_ can be either the location of a file (_./content/file.docx_) or a string of textual input (\"_# Hello, Bananas_\").\n\n#### args\n> The same list of arguments that pandoc accepts on the command line. Arguments are accepted as either a full String or as an Array.\n\n#### options\n> The options parameter accepts and passes along a Node Child_Process.Spawn object and is completely optional. View [a _complete_ list of Pandoc options on the Pandoc website](http://pandoc.org/README.html#options) or pull it from the command-line by typing:  \n```$ pandoc -h```\n\n#### callback\n> Function that call it called back with the parameters of (_error_, _result_).\n\n\n\n### Examples of Using Node-Pandoc\n\nConverting a word.docx file to a markdown.md\n\n```js\n// In EcmaScript 5...\n\nvar nodePandoc = require('node-pandoc');\nvar src, args, callback;\n\nsrc = './word.docx';\n\n// Arguments can be either a single string:\nargs = '-f docx -t markdown -o ./markdown.md';\n// Or in an array of strings -- careful no spaces are present:\nargs = ['-f','docx','-t','markdown','-o','markdown.md'];\n\n// Set your callback function\ncallback = function (err, result) {\n\n  if (err) {\n    console.error('Oh Nos: ',err);\n  }\n\n  // For output to files, the 'result' will be a boolean 'true'.\n  // Otherwise, the converted value will be returned.\n  console.log(result);\n  return result;\n};\n\n// Call pandoc\nnodePandoc(src, args, callback);\n```\n```js\n// In ES-6 (ES-2015)\nimport nodePandoc from 'node-pandoc'\n\nlet src = './word.docx';\n\n// Arguments can be either a single String or in an Array\nlet args = '-f docx -t markdown -o ./markdown.md';\n\n// Set your callback function\nconst callback = (err, result)=> {\n\n  if (err) console.error('Oh Nos: ',err)\n  return console.log(result), result\n}\n\n// Call pandoc\nnodePandoc(src, args, callback);\n```\n\nConverting a word.docx file and returning HTML.\n\n```js\nvar pandoc = require('node-pandoc'),\n    src = './word.docx',\n    // Arguments in either a single String or as an Array:\n    args = '-f docx -t html5';\n\n// Set your callback function\ncallback = function (err, result) {\n  if (err) console.error('Oh Nos: ',err);\n  // Without the -o arg, the converted value will be returned.\n  return console.log(result), result;\n};\n\n// Call pandoc\npandoc(src, args, callback);\n```\n\nThis also works the other way &rsquo;round; converting a bit of HTML and saving it as word.docx\n\n```js\nvar pandoc = require('node-pandoc'),\n    src = '<h1>Hello</h1><p>It&rsquo;s bananas</p>',\n    // Arguments in either a single String or as an Array:\n    args = '-f html -t docx -o word.docx';\n\n// Set your callback function\ncallback = function (err, result) {\n  if (err) console.error('Oh Nos: ',err);\n  // Without the -o arg, the converted value will be returned.\n  return console.log(result), result;\n};\n\n// Call pandoc\npandoc(src, args, callback);\n```\n\nOr give-a-string/get-a-string: Markdown -> HTML\n\n```js\nvar pandoc = require('node-pandoc'),\n    src = '# Hello \\n\\nIt\\'s bananas',\n    // Arguments in either a single String or as an Array:\n    args = '-f markdown -t html';\n\n// Set your callback function\ncallback = function (err, result) {\n  if (err) console.error('Oh Nos: ',err);\n  // Without the -o arg, the converted value will be returned.\n  return console.log(result), result;\n};\n\n// Call pandoc\npandoc(src, args, callback);\n```\n\n...and in reverse: HTML -> Markdown\n\n```js\nvar pandoc = require('node-pandoc'),\n    src = '<h1>Hello</h1><p>It&rsquo;s bananas</p>',\n    // Arguments in either a single String or as an Array:\n    args = '-f html -t markdown --atx-headers';\n\n// NOTE: The --atx-headers flag set above will produce <h1>s as:\n// # Hello\n//\n// ...while omitting --atx-headers flat will result in this style:\n// Hello\n// =====\n\n// Set your callback function\ncallback = function (err, result) {\n  if (err) console.error('Oh Nos: ',err);\n  // Without the -o arg, the converted value will be returned.\n  return console.log(result), result;\n};\n\n// Call pandoc\npandoc(src, args, callback);\n```\n\n## One more thing...\n\nIt does URLs too.\n\n```js\nvar pandoc = require('node-pandoc'),\n    src = 'https://www.npmjs.com/package/node-pandoc',\n    // Arguments in either a single String or as an Array:\n    args = '-f html -t docx -o node-pandoc.docx';\n\n// Set your callback function\ncallback = function (err, result) {\n  if (err) console.error('Oh Nos: ',err);\n  // Without the -o arg, the converted value will be returned.\n  return console.log(result), result;\n};\n\n// Call pandoc\npandoc(src, args, callback);\n```\n\n![Wokavagor](https://i.ytimg.com/vi/aDROVYwZ7IU/maxresdefault.jpg)\n> # ...it can go sideways and slantways and longways and backways and squareways and frontways and any other ways that you can think of.\n\n## License\n\nCopyright &copy; Eric Shinn  \nLicensed under the MIT License\n","maintainers":[{"name":"eshinn","email":"eric@eric.cx"}],"time":{"modified":"2022-06-21T17:49:35.985Z","created":"2016-02-04T00:35:21.086Z","0.1.0":"2016-02-04T00:35:21.086Z","0.1.1":"2016-02-04T00:42:05.003Z","0.2.0":"2016-02-05T21:18:35.325Z","0.3.0":"2016-12-15T13:31:44.374Z"},"homepage":"https://github.com/eshinn/node-pandoc#readme","keywords":["pandoc","node","docx","markdown"],"repository":{"type":"git","url":"git+https://github.com/eshinn/node-pandoc.git"},"author":{"name":"Eric Shinn","email":"eric.shinn@gmail.com"},"bugs":{"url":"https://github.com/eshinn/node-pandoc/issues"},"license":"MIT","readmeFilename":"README.md","users":{"eshinn":true,"leakynoggin":true,"myterminal":true,"nikhilexplore":true}}