@powel/pdf-gen
Advanced tools
Comparing version 0.1.1 to 0.1.2-beta.0
@@ -52,4 +52,4 @@ "use strict"; | ||
const filename = stats.isDirectory() ? null : fileOrDir; | ||
const dirname = filename ? _path.default.dirname(filename) : fileOrDir; | ||
const dirname = stats.isDirectory() ? fileOrDir : _path.default.dirname(fileOrDir); | ||
const filename = stats.isDirectory() ? null : _path.default.basename(fileOrDir); | ||
const files = filename ? [_path.default.join(dirname, filename)] : await asyncReadDir(dirname).then(files => files.map(file => _path.default.join(dirname, file))); | ||
@@ -56,0 +56,0 @@ const guideFiles = files.filter(isGuideFile); |
@@ -22,5 +22,12 @@ "use strict"; | ||
var _readPkgUp = require("read-pkg-up"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const asyncReadFile = (0, _util.promisify)(_fs.default.readFile); | ||
const { | ||
path: pkgPath | ||
} = (0, _readPkgUp.sync)({ | ||
cwd: _fs.default.realpathSync(process.cwd()) | ||
}); | ||
@@ -74,2 +81,3 @@ const modifyTOCMarkup = async html => { | ||
pug: { | ||
basedir: _path.default.dirname(pkgPath), | ||
bgImage: _fs.default.readFileSync(_path.default.join(__dirname, 'template', 'images', 'bg.png')).toString('base64'), | ||
@@ -76,0 +84,0 @@ headerImage: _fs.default.readFileSync(_path.default.join(__dirname, 'template', 'images', 'brand.png')).toString('base64') |
{ | ||
"name": "@powel/pdf-gen", | ||
"version": "0.1.1", | ||
"version": "0.1.2-beta.0+4216711", | ||
"description": "A CLI utility to print Markdown files to PDFs styled with Powel branding", | ||
@@ -39,2 +39,3 @@ "license": "UNLICENSED", | ||
"@types/node": "11.11.2", | ||
"@types/read-pkg-up": "3.0.1", | ||
"@types/update-notifier": "2.5.0", | ||
@@ -59,3 +60,3 @@ "cross-env": "5.2.0", | ||
}, | ||
"gitHead": "27d79e1c863ab8acaafcbf852e01bbcfed4658a3" | ||
"gitHead": "4216711ed48eab516b2643aa5be4a3dc833ffda2" | ||
} |
@@ -42,4 +42,4 @@ import meow, { Result } from 'meow'; | ||
const stats = fs.statSync(fileOrDir); | ||
const filename = stats.isDirectory() ? null : fileOrDir; | ||
const dirname = filename ? path.dirname(filename) : fileOrDir; | ||
const dirname = stats.isDirectory() ? fileOrDir : path.dirname(fileOrDir); | ||
const filename = stats.isDirectory() ? null : path.basename(fileOrDir); | ||
@@ -46,0 +46,0 @@ const files = filename |
@@ -9,2 +9,3 @@ import fs from 'fs'; | ||
import format from 'date-fns/format'; | ||
import { sync as readPkgUp } from 'read-pkg-up'; | ||
@@ -17,2 +18,6 @@ type Options = { | ||
const { path: pkgPath } = readPkgUp({ | ||
cwd: fs.realpathSync(process.cwd()) | ||
}); | ||
const modifyTOCMarkup = async (html: string) => { | ||
@@ -65,2 +70,3 @@ const $ = cheerio.load(html); | ||
pug: { | ||
basedir: path.dirname(pkgPath), | ||
bgImage: fs | ||
@@ -67,0 +73,0 @@ .readFileSync(path.join(__dirname, 'template', 'images', 'bg.png')) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 3 instances in 1 package
525
1
1805165
12
21