summd 0.1.7 → 0.1.8

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 (2) hide show
  1. package/dist/index.js +4 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { readFileSync } from 'fs';
3
- import { extname } from 'path';
3
+ import { extname, dirname, join } from 'path';
4
+ import { fileURLToPath } from 'url';
4
5
  import { createInterface } from 'readline';
5
6
  import { program } from 'commander';
7
+ const _pkg = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '../package.json'), 'utf8'));
6
8
  import { saveKey } from './config.js';
7
9
  import * as api from './api.js';
8
10
  import { urlToMarkdown } from './url-to-md.js';
@@ -47,7 +49,7 @@ function formatDate(iso) {
47
49
  program
48
50
  .name('summd')
49
51
  .description('Sum to anything.')
50
- .version('0.1.3')
52
+ .version(_pkg.version)
51
53
  .option('--key <token>', 'API key for this request')
52
54
  .option('--base <url>', 'Override API base URL');
53
55
  // ── summd key ─────────────────────────────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "summd",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "CLI for sum.md — Sum to anything.",
5
5
  "license": "MIT",
6
6
  "bin": {