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 🙏

© 2026 – Pkg Stats / Ryan Hefner

medium-poster

v1.3.1

Published

This module was born for posting article to Medium. And It can help you easily move articles from you local.

Readme

Medium-poster

This module was born for posting article to Medium. And It can help you easily move articles from you local.

Because this project's idea is come from hexo's need, so the default config is also fit the hexo.

Hope you using this module and writing articles well.

Environment

  • node version: 16.2.0

Road Map

  • source base commander, ex: mp
  • build test framework
  • handle exception

Restriction

Medium-poster is base on medium api, so it has limitation set by medium.

  1. 16 article posting per day.
  2. You should avoid table if you use markdown.

Get Started

  • Get token from medium, ref medium doc

  • Download module

npm install --save medium-poster
  • Init config
node -e "require('medium-poster').initConfig()"
  • Simple use

add example.js file first

// example.js
const MLoader = require('medium-poster');
const token = process.env.MEDIUM_TOKEN;

(async () => {
  await MLoader.postArticlesByConfig(token);
})()

// It will post md or html file to Medium base on your config

exec js file

node example.js

commander

  • install
npm i --save medium-poster
  • instruction
npx mp --help
  • init config
npx mp init --help
  • post article It will post single article by path and all other option will follow config.
npx mp post --help
npx mp post -t <token> <path>
  • batch post articles It will post multi articles by config directory.
npx mp batch --help
npx mp batch -t

Config

Sample

{
  "uploadDirPath": "./source/_posts",
  "excludeMds": [],
  "mediumOpts": {
    "canonicalUrl": "https://tim80411.github.io/code-blog/",
    "publishStatus": "public",
    "contentFormat": "markdown",
    "license": "cc-40-by-nc-sa",
    "tags": [],
    "publicationUrl": "https://medium.com/on-my-way-coding"
  },
  "articleOpts": {
    "isAddTitle": false
  }
}

Meaning

Config field like canonicalUrl is from medium api. You can find more detail from doc.

| Config Field | Required | Description | | :------------------------ | -------- | :------------------------------------------------------------------------------------------ | | uploadDirPath | V | 需要上傳文章的資料夾 | | excludeMds | | 上傳文章時排除此欄位包含的檔案名稱; 需包含副檔名 | | mediumOpts.canonicalUrl | | (medium api params) 原文章出處 | | mediumOpts.publishStatus | | (medium api params) 文章狀態: draft, publish, unlisted | | mediumOpts.contentFormat | | (medium api params) 文章用什麼格式被解析 | | mediumOpts.license | | (medium api params) license of article; 詳情參照medium api 文件 | | mediumOpts.tags | | (medium api params) 文章標籤,僅前三能被用上 | | mediumOpts.publicationUrl | | 輸入publication的網址,若token的身份具有在該publication發布文章的權限,則會將文章發佈在之上 | | articleOpts.isAddTitle | | (for hexo) 此欄位為true時會偵測hexo文章的title並加入內容中 |

Usage Example: post article by article path

use this line to post single article.

note: medium config is also depend on config.json

MEDIUM_TOKEN=xxx node -e "require('medium-poster').postArticleByPath('./source/_posts/xxx.md')"