Skip to content

Latest commit

 

History

History
106 lines (70 loc) · 3.43 KB

README.md

File metadata and controls

106 lines (70 loc) · 3.43 KB

Medium Article APIs

npm version created by star size npm downloads license

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.

Table of Contents

Installation

You can install this package using npm or yarn.

npm

npm i medium-article-api

yarn

yarn add medium-article-api

Usage

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}

Functions

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

Scripts

Build

To compile the TypeScript files to JavaScript, run:

npm run build

Test

To run tests, use:

npm run test

Configuration

TypeScript Configuration

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"
  },
}

Contributing

Support

engrmuhammk



LICENSE

This project is licensed under the MIT License - see the LICENSE file for details.