@fouaden/snipit 1.1.0 → 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,9 +6,9 @@
6
6
  </p>
7
7
 
8
8
  <p align="center">
9
- <a href="https://www.npmjs.com/package/@fouaden/snipit"><img src="https://img.shields.io/npm/v/snipit.svg" alt="npm version"></a>
10
- <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>
11
- <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License"></a>
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
+
12
12
  </p>
13
13
 
14
14
  <p align="center">
@@ -31,13 +31,21 @@ snipit stores them locally, tagged and searchable, ready to copy to your clipboa
31
31
  ## Install
32
32
 
33
33
  ```bash
34
- npm install -g snipit
34
+ npm i -g @fouaden/snipit
35
35
  ```
36
36
 
37
37
  **Requirements**: Node.js 18+
38
38
 
39
39
  ---
40
40
 
41
+ ## Note!
42
+
43
+ macOS/Linux: If you get an EACCES permission error, run
44
+
45
+ ```bash
46
+ sudo npm install -g @fouaden/snipit # This happens when npm's global folder is owned by root.
47
+ ```
48
+
41
49
  ## Quick Start
42
50
 
43
51
  ```bash
@@ -129,4 +137,4 @@ You can back it up, sync it with Dropbox, or commit it to a private repo — it'
129
137
 
130
138
  ## License
131
139
 
132
- 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,QA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U,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAEhC,OAAO,CAAC,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,8 +1,21 @@
1
1
  {
2
2
  "name": "@fouaden/snipit",
3
- "version": "1.1.0",
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
+ "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "bin": {
9
+ "snipit": "./bin/snipit.js"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/fouadbuilds/snipit.git"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/fouadbuilds/snipit/issues"
17
+ },
18
+ "homepage": "https://github.com/fouadbuilds/snipit#readme",
6
19
  "scripts": {
7
20
  "dev": "tsx bin/snipit.js",
8
21
  "build": "tsc",
@@ -11,9 +24,6 @@
11
24
  "test:run": "vitest run",
12
25
  "test:ui": "vitest --ui"
13
26
  },
14
- "bin": {
15
- "snipit": "./bin/snipit.js"
16
- },
17
27
  "files": [
18
28
  "dist/",
19
29
  "bin/"
@@ -32,7 +42,6 @@
32
42
  ],
33
43
  "author": "fouadbuilds",
34
44
  "license": "MIT",
35
- "type": "module",
36
45
  "devDependencies": {
37
46
  "@types/node": "^25.3.0",
38
47
  "ts-node": "^10.9.2",