saveinme 1.3.1 → 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/README.md +9 -1
- package/package.json +1 -1
- package/src/display.js +16 -7
package/README.md
CHANGED
|
@@ -4,12 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
+
To install globally from npm:
|
|
8
|
+
```bash
|
|
9
|
+
npm install -g saveinme
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Or for local development:
|
|
7
13
|
```bash
|
|
8
14
|
cd path/to/saveinme
|
|
9
15
|
npm install
|
|
10
|
-
npm link
|
|
16
|
+
npm link
|
|
11
17
|
```
|
|
12
18
|
|
|
19
|
+
> **Note:** Once installed, both the **`saveinme`** and **`sim`** commands are registered globally and can be used interchangeably in any terminal window!
|
|
20
|
+
|
|
13
21
|
## Commands
|
|
14
22
|
|
|
15
23
|
> Both `saveinme` and `sim` can be used interchangeably!
|
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
|
}
|
|
@@ -234,6 +241,8 @@ export function showHelp() {
|
|
|
234
241
|
================================================================================
|
|
235
242
|
🚀 ${chalk.bold.yellow('COMMANDS CHEAT SHEET (QUICK OVERVIEW)')}
|
|
236
243
|
================================================================================
|
|
244
|
+
${chalk.dim(' * Note: You can use "saveinme" or the shortcut "sim" interchangeably *')}
|
|
245
|
+
|
|
237
246
|
${chalk.bold.white('sim')} List all saved notes (pinned first)
|
|
238
247
|
${chalk.bold.white('sim -c')} [${chalk.italic('title')}] Create/edit a note interactively
|
|
239
248
|
${chalk.bold.white('sim -cl')} [${chalk.italic('title')}] Instantly save text from your clipboard
|