pandocjs
TypeScript icon, indicating that this package has built-in type declarations

2.9.2-1.1 • Public • Published

pandocjs

Another wrapper for pandoc, including automatic binary download.

js-semistandard-style vscode-cspell-style github-release-packager-issues github-release-packager-style github-release-packager-license github-release-packager-version

Installation

npm i pandocjs

Why?

Because I couldn't any npm package to wrap pandoc for use with JavaScript in node without requiring pandoc to be already installed locally. This package installs the required binaries in the background, independent in means of version and binaries from a locally pandoc installation.

Usage

To convert the contents of an existing file (docbook format) info to a file in markdown format, use the ConvertFileSync() method:

const pandoc = require('pandocjs');
 
pandoc.ConvertFileSync('document.xml', 'docbook', 'document.md', 'gfm', { atxHeaders: true, wrap: 'preserve' });

Development Support

There's plenty of JsDoc documentation included in this package (auto generated calling pandoc with the --help, --list-input-formats and --list-output-formats options). If your development environment provides assistance by reading this information, all methods can be used pretty straight forward (e.g. Visual Studio Code reads the JsDoc comments to include it in the Intellisense feature).

Package Sidebar

Install

npm i pandocjs

Weekly Downloads

8

Version

2.9.2-1.1

License

MIT

Unpacked Size

51.9 kB

Total Files

9

Last publish

Collaborators

  • thorbenw