letter-press
Advanced tools
Comparing version 1.1.4 to 1.1.5
26
index.js
@@ -13,5 +13,8 @@ const fs = require('fs') | ||
async function press (id, md, dist) { | ||
const mdPath = path.join(dist, id + '.md') | ||
const htmlPath = path.join(dist, id + '.html') | ||
const pdfPath = path.join(dist, id + '.pdf') | ||
const mdName = id + '.md' | ||
const htmlName = id + '.html' | ||
const pdfName = id + '.pdf' | ||
const mdPath = path.join(dist, mdName) | ||
const htmlPath = path.join(dist, htmlName) | ||
const pdfPath = path.join(dist, pdfName) | ||
@@ -21,15 +24,16 @@ try { | ||
write(mdPath, md) | ||
.then(file => console.log('File written: ' + file)) | ||
.catch(console.error) | ||
.then(file => console.log('✨ ' + mdName + ' done')) | ||
.catch(e => console.error('🚨 ' + e)) | ||
// write html | ||
const html = await ghmd(id, md).catch(e => console.error(e)) | ||
const html = await ghmd(id, md) | ||
.catch(e => console.error('🚨 ' + e)) | ||
await write(htmlPath, html) | ||
.then(file => console.log('File written: ' + file)) | ||
.catch(console.error) | ||
.then(file => console.log('✨ ' + htmlName + ' done')) | ||
.catch(e => console.error('🚨 ' + e)) | ||
// write pdf | ||
pdf(htmlPath, pdfPath) | ||
.then(file => console.log('File written: ' + file)) | ||
.catch(console.error) | ||
.then(file => console.log('✨ ' + pdfName + ' done')) | ||
.catch(e => console.error('🚨 ' + e)) | ||
} catch (e) { | ||
@@ -56,3 +60,3 @@ throw e | ||
if (browser && browser.close) { | ||
console.error('Error: Problem printing PDF. Closing browser...') | ||
console.error('🚨 Error: Problem printing PDF. Closing browser...') | ||
browser.close() | ||
@@ -59,0 +63,0 @@ } |
{ | ||
"name": "letter-press", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7751
171