pfwr 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +3 -3
  2. package/bin/cli.js +11 -6
  3. package/dist/index.js +2503 -3992
  4. package/package.json +8 -8
package/README.md CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  [![CI](https://github.com/nikku/pfwr/actions/workflows/CI.yml/badge.svg)](https://github.com/nikku/pfwr/actions/workflows/CI.yml)
4
4
 
5
- Turns your [Markdown file](https://github.com/nikku/pfwr/blob/main/README.md#example) into [a beautiful HTML slide deck](https://cdn.statically.io/gh/nikku/pfwr/v0.13.0/example/presentation.html). Batteries included.
5
+ Turns your [Markdown file](https://github.com/nikku/pfwr/blob/main/README.md#example) into [a beautiful HTML slide deck](https://cdn.statically.io/gh/nikku/pfwr/v0.14.0/example/presentation.html). Batteries included.
6
6
 
7
7
 
8
8
  ## Introduction
9
9
 
10
- [![Slide deck generated from Markdown via pfwr](https://raw.githubusercontent.com/nikku/pfwr/main/docs/screenshot.png)](https://cdn.statically.io/gh/nikku/pfwr/v0.13.0/example/presentation.html)
10
+ [![Slide deck generated from Markdown via pfwr](https://raw.githubusercontent.com/nikku/pfwr/main/docs/screenshot.png)](https://cdn.statically.io/gh/nikku/pfwr/v0.14.0/example/presentation.html)
11
11
 
12
12
 
13
13
  ## Usage
@@ -74,7 +74,7 @@ Convert the file to an HTML file:
74
74
  pfwr presentation.md presentation.html
75
75
  ```
76
76
 
77
- Open [the slide deck](https://cdn.statically.io/gh/nikku/pfwr/v0.13.0/example/presentation.html) in your favorite browser.
77
+ Open [the slide deck](https://cdn.statically.io/gh/nikku/pfwr/v0.14.0/example/presentation.html) in your favorite browser.
78
78
 
79
79
 
80
80
  ## Security Considerations
package/bin/cli.js CHANGED
@@ -6,17 +6,22 @@ import path from 'node:path';
6
6
  import fs from 'node:fs';
7
7
  import process from 'node:process';
8
8
 
9
- import { fileURLToPath } from 'node:url';
10
-
11
9
  import mri from 'mri';
12
10
  import opener from 'opener';
13
11
 
14
12
  import { debounce } from 'min-dash';
15
13
 
16
- const __filename = fileURLToPath(import.meta.url);
17
- const __dirname = path.dirname(__filename);
14
+ /**
15
+ * @param {string} path
16
+ *
17
+ * @return {URL} file url for the local path
18
+ */
19
+ function fileUrl(path) {
20
+ return new URL(path, import.meta.url);
21
+ }
22
+
23
+ const pkg = JSON.parse(fs.readFileSync(fileUrl('../package.json'), 'utf8'));
18
24
 
19
- const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'), 'utf8'));
20
25
 
21
26
  const argv = process.argv.slice(2);
22
27
 
@@ -68,7 +73,7 @@ async function run() {
68
73
  if (!fs.existsSync(inputFile)) {
69
74
  console.log('Created %s', inputFile);
70
75
 
71
- fs.copyFileSync(__dirname + '/template.md', inputFile);
76
+ fs.copyFileSync(fileUrl('./template.md'), inputFile);
72
77
  }
73
78
 
74
79
  const input = {