https://github.com/leadcodedev/notion-parser
https://github.com/leadcodedev/notion-parser
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/leadcodedev/notion-parser
- Owner: LeadcodeDev
- License: mit
- Created: 2022-03-28T17:32:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-29T08:37:15.000Z (almost 4 years ago)
- Last Synced: 2025-07-25T11:58:23.633Z (7 months ago)
- Language: TypeScript
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🧱 Notion parser
```ts
(async () => {
const token = 'secret_api_token'
const notionClient = new NotionClient(token, '2022-02-22')
const pageId: string = 'pageId'
const page = await notionClient.getPage(pageId)
const blocs = await notionClient.getBlocks(pageId)
const options: HtmlConfig = {
separator: '\n\n'
}
const html = blocs.reduce((acc: string, block) => acc += block.render(options) , '')
console.log(html)
})()
```