README
Vietcetera
An Unofficial Node.js API Client for Vietcetera
Installation
npm install vietcetera
# OR
yarn add vietcetera
API Usage
const vietcetera: Vietcetera = new Vietcetera();
Get Favorist Topics
const language: string = 'VN'; // OPTIONAL - default to VN - enumeration: 'VN' or 'EN'
const topics = await vietcetera.getFavoristTopics(language);
Get Articles
- Basic
const type: string = 'recommend-popular'; // OPTIONAL - default to 'latest' - enumeration: 'latest' OR 'popular' OR 'editor-pick' OR 'recommend-popular'
const language: string = 'VN'; // OPTIONAL - default to 'VN' - enumeration: 'VN' or 'EN'
const page: number = 1 // OPTIONAL - only for 'latest' AND 'popular'
const limit: number = 10 // OPTIONAL - only for 'latest' AND 'popular'
const options: Object = { type, language, page, limit };
const articles = await vietcetera.getArticles(options);
- Latest (Shortcut)
const language: string = 'VN'; // OPTIONAL - default to 'VN' - enumeration: 'VN' or 'EN'
const page: number = 1 // OPTIONAL - only for 'latest' AND 'popular'
const limit: number = 10 // OPTIONAL - only for 'latest' AND 'popular'
const options: Object = { language, page, limit };
const articles = await vietcetera.getLatestArticles(options);
- Popular (Shortcut)
const language: string = 'VN'; // OPTIONAL - default to 'VN' - enumeration: 'VN' or 'EN'
const page: number = 1 // OPTIONAL - only for 'latest' AND 'popular'
const limit: number = 10 // OPTIONAL - only for 'latest' AND 'popular'
const options: Object = { language, page, limit };
const articles = await vietcetera.getPopularArticles(options);
- Editor Pick (Shortcut)
const language: string = 'VN'; // OPTIONAL - default to 'VN' - enumeration: 'VN' or 'EN'
const articles = await vietcetera.getEditorPickArticles(language);