sondakika 1.0.0 → 1.0.1

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 (3) hide show
  1. package/README.md +94 -0
  2. package/index.js +6 -3
  3. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,94 @@
1
+ # Sondakika
2
+
3
+ Terminal-based CLI tool to fetch and display breaking news from RSS feeds.
4
+
5
+ ![sondakika](https://img.shields.io/badge/sondakika-news%20CLI-blue)
6
+ ![Node.js](https://img.shields.io/badge/Node.js-14%2B-green)
7
+ ![License](https://img.shields.io/badge/License-ISC-yellow)
8
+
9
+ ## Features
10
+
11
+ - 📰 Fetch news from multiple Turkish news sources
12
+ - 🔗 Clickable URLs in terminal (iTerm2, Windows Terminal, macOS Terminal)
13
+ - 🎨 Styled terminal output with Unicode borders
14
+ - ⚡ Fast and lightweight
15
+
16
+ ## Installation
17
+
18
+ ### Using npx (no install)
19
+
20
+ ```bash
21
+ npx sondakika ntv
22
+ ```
23
+
24
+ ### Global install
25
+
26
+ ```bash
27
+ npm install -g sondakika
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ```bash
33
+ # Show NTV news (default 10 items)
34
+ sondakika ntv
35
+
36
+ # Show 15 NTV news items
37
+ sondakika ntv 15
38
+
39
+ # Show Cumhuriyet news
40
+ sondakika cumhuriyet
41
+
42
+ # Show Cumhuriyet news with custom count
43
+ sondakika cumhuriyet 20
44
+ ```
45
+
46
+ ### Available Sources
47
+
48
+ | Command | Source |
49
+ |---------|--------|
50
+ | `ntv` | NTV Son Dakika |
51
+ | `cumhuriyet` | Cumhuriyet |
52
+
53
+ ### Help
54
+
55
+ ```bash
56
+ sondakika
57
+ # or
58
+ sondakika --help
59
+ ```
60
+
61
+ ## Output Example
62
+
63
+ ```
64
+ 📰 ══════════════════════════════════════════════════
65
+ Latest 10 News from NTV
66
+ ══════════════════════════════════════════════════
67
+
68
+ ┌─ 1. Son dakika deprem mi oldu?
69
+
70
+ │ Son depremler...
71
+ └─────────────────────────────────────────────────────────────────────
72
+ 🔗 https://www.ntv.com.tr/...
73
+ ```
74
+
75
+ ## Development
76
+
77
+ ```bash
78
+ # Clone and install
79
+ npm install
80
+
81
+ # Run locally
82
+ npm start
83
+
84
+ # Link for global testing
85
+ npm link
86
+ ```
87
+
88
+ ## License
89
+
90
+ ISC
91
+
92
+ ## Author
93
+
94
+ Sedat ERGOZ
package/index.js CHANGED
@@ -3,7 +3,8 @@
3
3
  const Parser = require('rss-parser');
4
4
 
5
5
  const sources = {
6
- ntv: 'https://www.ntv.com.tr/son-dakika.rss'
6
+ ntv: 'https://www.ntv.com.tr/son-dakika.rss',
7
+ cumhuriyet: 'http://www.cumhuriyet.com.tr/rss/son_dakika.xml'
7
8
  };
8
9
 
9
10
  const parser = new Parser();
@@ -76,6 +77,8 @@ async function fetchNews(source, count) {
76
77
  separator();
77
78
  console.log();
78
79
  });
80
+
81
+ process.exit(0);
79
82
  } catch (err) {
80
83
  console.error('Error fetching news:', err.message);
81
84
  process.exit(1);
@@ -85,9 +88,9 @@ async function fetchNews(source, count) {
85
88
  const args = process.argv.slice(2);
86
89
 
87
90
  if (args.length === 0) {
88
- console.log('Usage: news <source> [count]');
91
+ console.log('Usage: sondakika <source> [count]');
89
92
  console.log(`Available sources: ${Object.keys(sources).join(', ')}`);
90
- console.log('Example: news ntv 15');
93
+ console.log('Example: sondakika ntv 15');
91
94
  process.exit(1);
92
95
  }
93
96
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "sondakika",
3
- "version": "1.0.0",
4
- "description": "CLI to display breaking news from RSS feeds",
3
+ "version": "1.0.1",
4
+ "description": "Son dakika haberlerine komut satiri uzerinden ulasin.",
5
5
  "main": "index.js",
6
6
  "bin": {
7
- "news": "index.js"
7
+ "sondakika": "index.js"
8
8
  },
9
9
  "scripts": {
10
10
  "start": "node index.js"