fresh-ts
v1.0.2
Published
A TypeScript client for the FreshRSS API
Maintainers
Readme
Fresh-ts
A TypeScript client for the FreshRSS API.
Installation
npm install fresh-tsUsage
import { FreshFetchClient } from 'fresh-ts';
const client = new FreshFetchClient({
host: 'https://your-freshrss-instance.com',
username: 'your-username',
password: 'your-password'
});
// Get items from the last 7 days
async function main(): Promise<void> {
const endDate = new Date();
const startDate = new Date();
startDate.setDate(endDate.getDate() - 7);
console.log(await client.getItemsFromDates(startDate, endDate));
}
main().catch(console.error);API
Constructor Options
host: Your FreshRSS instance URLusername: Your FreshRSS usernamepassword: Your FreshRSS passworddebug: Enable debug logging (default: false)
Methods
getFeeds(): Get all feedsgetGroups(): Get all groupsgetUnreads(): Get unread itemsgetSaved(): Get saved itemsgetItemsFromIds(ids): Get items by IDsgetItemsFromDates(since, until): Get items from date rangesetMark(action, id): Mark item as read/saved/unsaved
License
MIT © Niklas Wockenfuß
