@clarionstack/notesia 0.0.8 → 0.0.9

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/bin/notesia.mjs +13 -0
  2. package/package.json +1 -1
package/bin/notesia.mjs CHANGED
@@ -1,9 +1,22 @@
1
1
  #!/usr/bin/env node
2
+ import { createRequire } from 'module';
3
+ import { fileURLToPath } from 'url';
4
+ import { dirname, resolve } from 'path';
2
5
  import { runCli } from '../src/commands.mjs';
3
6
  import { runImport } from '../src/import.mjs';
4
7
 
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const require = createRequire(import.meta.url);
10
+
5
11
  const argv = process.argv.slice(2);
6
12
 
13
+ // Handle version flag / command
14
+ if (argv[0] === 'version' || argv[0] === '-v' || argv[0] === '--version') {
15
+ const { version } = require(resolve(__dirname, '../package.json'));
16
+ process.stdout.write(`notesia v${version}\n`);
17
+ process.exit(0);
18
+ }
19
+
7
20
  // Dispatch `notesia import` to the dedicated import handler
8
21
  if (argv[0] === 'import') {
9
22
  runImport(argv.slice(1)).catch((error) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@clarionstack/notesia",
3
3
  "private": false,
4
- "version": "0.0.8",
4
+ "version": "0.0.9",
5
5
  "description": "Notesia desktop bridge CLI — read, write, and bulk-import notes",
6
6
  "type": "module",
7
7
  "files": [