npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

medium-api-npm

v2.0.0

Published

Get all your medium articles and display in your website or create an article and post it from your website and many more awesome stuff

Downloads

7

Readme

medium-api-npm

Get your medium articles and display in your website or write an article and post it from your website.

0. To get auth-code:

 Go to your medium account -> profile icon -> settings -> integration tokens -> generate token

1. To fetch user data, posts, publications from medium:

const { getMediumArticles } =  require("medium-api-npm");
getMediumArticles({
  auth: "auth-code",
}).then((data) => console.log(data));

2. To add a post to medium:

const { addPost } =  require("medium-api-npm");
addPost({
  auth: "auth-code",
  title: "test",
  html: "<p>test</p>",
  canonicalUrl: "https://medium.com/@test",
  tags: ["test"],
  publishStatus: "draft",
}).then((data) => console.log(data));

| Parameter | Type | Required? | Description | | ------------- |--------------|------------|-------------------------------------------------| | title | string | required | The title of the post. Note that this title is used for SEO and when rendering the post as a listing, but will not appear in the actual post—for that, the title must be specified in the content field as well. Titles longer than 100 characters will be ignored. In that case, a title will be synthesized from the first content in the post when it is published. | | contentFormat | string | required | The format of the "content" field. There are two valid values, "html", and "markdown" | | content | string | required | The body of the post, in a valid, semantic, HTML fragment, or Markdown. Further markups may be supported in the future. For a full list of accepted HTML tags, see here. If you want your title to appear on the post page, you must also include it as part of the post content. | | tags | string array | optional | Tags to classify the post. Only the first three will be used. Tags longer than 25 characters will be ignored. | | canonicalUrl | string | optional | The original home of this content, if it was originally published elsewhere. | | publishStatus | enum | optional | The status of the post. Valid values are “public”, “draft”, or “unlisted”. The default is “public”. | | license | enum | optional | The license of the post. Valid values are “all-rights-reserved”, “cc-40-by”, “cc-40-by-sa”, “cc-40-by-nd”, “cc-40-by-nc”, “cc-40-by-nc-nd”, “cc-40-by-nc-sa”, “cc-40-zero”, “public-domain”. The default is “all-rights-reserved”. | | notifyFollowers | bool | optional | Whether to notifyFollowers that the user has published. |

Enjoy blogging !