Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/arpitbhalla/notion2mdblog

Convert notion page📜 to markdown 🔖
https://github.com/arpitbhalla/notion2mdblog

notion notion-blog notion-markdown notion-md notion-sdk notion2blog notion2md

Last synced: 4 months ago
JSON representation

Convert notion page📜 to markdown 🔖

Awesome Lists containing this project

README

        

# Notion to markdown blog

## Install

```bash
npm install notion2mdblog
```

```bash
yarn add notion2mdblog
```

## Usage

```typescript
// Client is extended from @notionhq/client
import { Client } from "notion2mdblog";
import fs from "node:fs";

// Initializing a client
const notion = new Client({
auth: process.env.NOTION_KEY,
});

async function main() {
const blogPages = await notion.markdown.db2md({
database_id: NOTION_DATABASE_ID,
});
blogPages.map((blogPage) => {
fs.writeFileSync(`blogs/${blogPage.title}`, blogPage.content);
});
}
main();
```