saveinme 1.3.2 → 1.3.3
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.
- package/package.json +1 -1
- package/src/display.js +14 -7
package/package.json
CHANGED
package/src/display.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import boxen from 'boxen';
|
|
3
3
|
import Table from 'cli-table3';
|
|
4
|
+
import { readFileSync } from 'fs';
|
|
5
|
+
import { join, dirname } from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
|
|
10
|
+
const VERSION = pkg.version;
|
|
4
11
|
|
|
5
12
|
// ─── Color palettes ────────────────────────────────────────────────────────────
|
|
6
13
|
|
|
@@ -48,8 +55,8 @@ export function formatDate(iso) {
|
|
|
48
55
|
|
|
49
56
|
export function showHeader() {
|
|
50
57
|
const logo =
|
|
51
|
-
chalk.bold.cyanBright('💾 saveinme') +
|
|
52
|
-
chalk.dim(
|
|
58
|
+
chalk.bold.cyanBright('💾 saveinme (sim)') +
|
|
59
|
+
chalk.dim(` v${VERSION}`) +
|
|
53
60
|
'\n' +
|
|
54
61
|
chalk.dim('your personal terminal notebook');
|
|
55
62
|
|
|
@@ -135,11 +142,11 @@ export function showNotesList(notes, heading = null) {
|
|
|
135
142
|
console.log(
|
|
136
143
|
chalk.dim(
|
|
137
144
|
`\n ${notes.length} note${notes.length !== 1 ? 's' : ''} saved` +
|
|
138
|
-
` ·
|
|
139
|
-
` ·
|
|
140
|
-
` ·
|
|
141
|
-
` ·
|
|
142
|
-
` ·
|
|
145
|
+
` · sim -c create` +
|
|
146
|
+
` · sim -cl paste clip` +
|
|
147
|
+
` · sim -v <title> view` +
|
|
148
|
+
` · sim -f <term> search` +
|
|
149
|
+
` · sim -h help\n`
|
|
143
150
|
)
|
|
144
151
|
);
|
|
145
152
|
}
|