notion-parser
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

🧱 Notion parser

(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)
})()

Dependencies (6)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i notion-parser

    Weekly Downloads

    1

    Version

    0.2.2

    License

    none

    Unpacked Size

    48.8 kB

    Total Files

    48

    Last publish

    Collaborators

    • leadcodedev