@fouaden/snipit 1.1.1 → 1.1.2

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 CHANGED
@@ -6,12 +6,10 @@
6
6
  </p>
7
7
 
8
8
  <p align="center">
9
- <a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node.js-18%2B-339933?logo=node.js" alt="Node.js 18+"></a>
10
- <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License"></a>
11
- </p>
12
-
13
-
9
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node.js-18%2B-339933?logo=node.js" alt="Node.js 18+"></a>
10
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License"></a>
14
11
 
12
+ </p>
15
13
 
16
14
  <p align="center">
17
15
  <a href="#install">Install</a> •
@@ -36,14 +34,15 @@ snipit stores them locally, tagged and searchable, ready to copy to your clipboa
36
34
  npm i -g @fouaden/snipit
37
35
  ```
38
36
 
39
-
40
37
  **Requirements**: Node.js 18+
41
38
 
42
39
  ---
43
40
 
44
41
  ## Note!
42
+
45
43
  macOS/Linux: If you get an EACCES permission error, run
46
- ``` bash
44
+
45
+ ```bash
47
46
  sudo npm install -g @fouaden/snipit # This happens when npm's global folder is owned by root.
48
47
  ```
49
48
 
@@ -138,4 +137,4 @@ You can back it up, sync it with Dropbox, or commit it to a private repo — it'
138
137
 
139
138
  ## License
140
139
 
141
- MIT
140
+ MIT
package/bin/snipit.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import '../dist/index.js';
2
+ import '../dist/src/index.js';
package/dist/src/index.js CHANGED
@@ -1,17 +1,36 @@
1
1
  import { Command } from "commander";
2
+ import picocolors from "picocolors";
2
3
  import { getCommand } from "./commands/get.js";
3
4
  import { saveCommand } from "./commands/save.js";
4
5
  import { deleteCommand } from "./commands/delete.js";
5
6
  import { listCommand } from "./commands/list.js";
6
7
  const program = new Command();
8
+ const logo = picocolors.cyan(String.raw `
9
+ /$$ /$$ /$$
10
+ |__/ |__/ | $$
11
+ /$$$$$$$ /$$$$$$$ /$$ /$$$$$$ /$$ /$$$$$$
12
+ /$$_____/| $$__ $$| $$ /$$__ $$| $$|_ $$_/
13
+ | $$$$$$ | $$ \ $$| $$| $$ \ $$| $$ | $$
14
+ \____ $$| $$ | $$| $$| $$ | $$| $$ | $$ /$$
15
+ /$$$$$$$/| $$ | $$| $$| $$$$$$$/| $$ | $$$$/
16
+ |_______/ |__/ |__/|__/| $$____/ |__/ \___/
17
+ | $$
18
+ | $$
19
+ |__/
20
+ `);
21
+ const tagline = `${picocolors.yellow('Stop re-typing; start snipping.')}\n`;
7
22
  program
8
23
  .name('snipit')
9
24
  .description('A local snippet manager')
10
- .version('1.0.0');
25
+ .version('1.1.1')
26
+ .addHelpText('before', logo + tagline);
11
27
  // Commands
12
28
  program.addCommand(saveCommand);
13
29
  program.addCommand(getCommand);
14
30
  program.addCommand(deleteCommand);
15
31
  program.addCommand(listCommand);
16
32
  program.parse(process.argv);
33
+ if (!process.argv.slice(2).length) {
34
+ program.outputHelp();
35
+ }
17
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CAAC,yBAAyB,CAAC;KACtC,OAAO,CAAC,OAAO,CAAC,CAAA;AAGjB,WAAW;AAC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KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAG5B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;AACvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fouaden/snipit",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "A lightweight CLI tool to save, search and tag code snippets locally. Stop re-typing; start snipping.",
5
5
  "main": "bin/snipit.js",
6
6
  "types": "dist/index.d.ts",
@@ -55,4 +55,4 @@
55
55
  "commander": "^14.0.3",
56
56
  "picocolors": "^1.1.1"
57
57
  }
58
- }
58
+ }