# markdown-blog-push-tool

> A tool for processing markdown file blogs, supports uploading blog platforms and uploading pictures to image beds

Latest version **1.1.4** (published 2023-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdown-blog-push-tool
pnpm add markdown-blog-push-tool
yarn add markdown-blog-push-tool
bun add markdown-blog-push-tool
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2023-02-04 |
| First published | 2023-01-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 375.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | bitbw |
| Maintainers | bitbw |
| Keywords | markdown, blog, MetaWeblog, gray-matter, hexo, docusaurus, nodejs |

## Links

- npm: https://www.npmjs.com/package/markdown-blog-push-tool
- Repository: https://github.com/bitbw/markdown-blog-push-tool
- Homepage: https://github.com/bitbw/markdown-blog-push-tool#readme
- Issues: https://github.com/bitbw/markdown-blog-push-tool/issues
- npm.io page: https://npm.io/package/markdown-blog-push-tool

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^1.2.6
- [form-data](https://npm.io/package/form-data.md) ^4.0.0
- [gray-matter](https://npm.io/package/gray-matter.md) ^4.0.3
- [metaweblog-api](https://npm.io/package/metaweblog-api.md) ^1.2.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.1.4 (latest) — 2023-02-04
- 1.1.3 — 2023-02-04
- 1.1.1 — 2023-02-02
- 1.1.0 — 2023-02-02
- 1.0.1 — 2023-02-02
- 1.0.0 — 2023-01-31

## README

# Markdown blog push tool for node.js

A tool for processing markdown file blogs, supports uploading blog platforms and uploading pictures to image beds

The md files of hexo and docusaurus can be uploaded

This project uses [metaweblog-api](https://github.com/uhavemyword/metaweblog-api) to complete the blog upload

## install

```bash
npm install markdown-blog-push-tool
```

## Usage

### init

```js
const MarkdownBlogPushTool = require("../");
const { resolve } = require("path");
const Authorization = "xxx"; // TODO :  use your smms Authorization
const apiUrl = "xxx"; // TODO : use your blog API instead
const username = "xxx"; // TODO: your username
const password = "xxx"; // TODO: use your password
const replaceURL = true; // TODO: is replaceURL
const replaceURLReg = new RegExp("https://s2.loli.net/"); // TODO: replaceURL rule
const markdownBlogPushTool = new MarkdownBlogPushTool(
  { apiUrl, username, password }, // metaWeblogOptions
  { Authorization, replaceURL, replaceURLReg } // replaceImgOptions
);

```

### upload and replace all images and push all post to apiUrl

```js
// TODO: your md file dir
const path = resolve(__dirname, "./assets");
//  upload and replace all images and push all post to apiUrl
markdownBlogPushTool.pushMarkdownBlog(path, true);

```

### push all post to apiUrl

```js
// push all post to apiUrl
markdownBlogPushTool.pushMarkdownBlog(path);

```

### upload and replace all images

```js
// upload and replace all images
markdownBlogPushTool.replaceImgUrl(path);
```

### example

[example](https://github.com/bitbw/markdown-blog-push-tool/tree/main/__test)

## reference

- [metaweblog-api](https://github.com/uhavemyword/metaweblog-api)
- [SM.MS API](https://doc.sm.ms/)

---
_Source: https://npm.io/package/markdown-blog-push-tool · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
