github simonhaenisch/md-to-pdf v2.5.0
2.5.0

latest releases: v5.2.4, v5.2.3, v5.2.2...
5 years ago

New programmatic API

md-to-pdf can now be used programmatically instead of just from the CLI. For now, the API is very simplistic, exposing only one function mdToPdf(mdFile, config):

const mdToPdf = require('md-to-pdf');
 
(async () => {
  const pdf = await mdToPdf('readme.md', { dest: 'readme.pdf' }).catch(console.error);
 
  if (pdf) {
    console.log(pdf.filename);
  }
})();

dest was added as a new config option so the pdf output path can be set.

The plan for the future is to expose an API that can take a list of files and process them concurrently, i. e. reusing the same Chromium instance. However that requires a breaking change/major release and needs a few internal changes (e. g. finding the common parent directory for all files), so I want to do some restructuring of the code first.

Don't miss a new md-to-pdf release

NewReleases is sending notifications on new releases.