Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amscotti/hn-node
A command-line Node.js / Bun application that fetches and displays the top stories from Hacker News.
https://github.com/amscotti/hn-node
bun command-line hackernews hackernews-api nodejs
Last synced: 17 days ago
JSON representation
A command-line Node.js / Bun application that fetches and displays the top stories from Hacker News.
- Host: GitHub
- URL: https://github.com/amscotti/hn-node
- Owner: amscotti
- License: mit
- Created: 2023-06-17T23:27:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-12T21:50:53.000Z (10 months ago)
- Last Synced: 2024-12-16T16:12:40.800Z (22 days ago)
- Topics: bun, command-line, hackernews, hackernews-api, nodejs
- Language: JavaScript
- Homepage:
- Size: 271 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node.js Hacker News Fetcher
![Command-line Output](/images/output.png)
A command-line Node.js application that fetches and displays the top stories from Hacker News in a clean, easy-to-read format. It supports customization options such as the number of stories to fetch and whether to display source URLs. Ideal for quick updates without leaving your terminal.
This project is a Node.js port of the [Go](https://github.com/amscotti/hacker_news) and [C#](https://github.com/amscotti/hn-top) versions. It is also compatible with the [Bun](https://bun.sh/) JavaScript runtime.
This project requires Node.js version 20+ as it utilizes the `fetch` API.
## Usage
The application supports the following command-line options:
```
Options:
-n, --number Number of top news to show [number] [default: 5]
-u, --sourceUrls Show source urls [boolean] [default: false]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
```Example usage with options:
Fetch and display the top 10 stories with their source URLs:
```bash
npm start -- -n 10 -u
```## License
This project is licensed under the MIT License.
## Contributing
Pull requests are welcome.