A npm package designed to fetch user details and articles from Medium. This package provides a simple and efficient way to easily integrate Medium content into their applications.
You can install this package using npm or yarn.
npm i medium-article-api
yarn add medium-article-api
Here is a simple example to get you started:
import { MediumArticles } from 'medium-article-api';
const mediumArticles = MediumArticles();
const username = '<your-medium-username>';
mediumArticles.getProfileUrl(username).then( (result) => console.log('The profile url is ', result));
// https://medium.com/feed/@engrmuhammadusman108}
Function | Arguments | Output |
---|---|---|
getData | username: string | string |
getProfileUrl | username: string | string |
getProfileTitle | username: string | string |
getProfileAuthor | username: string | string |
getProfileDescription | username: string | string |
getProfileImageUrl | username: string | string |
getLatestArticleTitle | username: string | array[string] |
getLatestArticlePublicationDate | username: string | string |
getLatestArticleUrl | username: string | string |
getLatestArticleDescription | username: string | html |
getLatestArticle | username: string | object |
getLatestArticlesTitle | username: string | string |
To compile the TypeScript files to JavaScript, run:
npm run build
To run tests, use:
npm run test
This package uses a tsconfig.json
file for TypeScript configuration. Here is an example:
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "./dist"
},
}
This project is licensed under the MIT License - see the LICENSE file for details.