Notion API client.
$ yarn add nocean
type TDownloadMarkdownOptions = {
// value of `token_v2` cookie
token: string
// https://www.notion.so/<ACCOUNT>/<PAGE>-<BLOCK_ID>
blockId: string,
// relative to current working directory
outputDirPath: string,
}
const downloadMarkdown: (options: TDownloadMarkdownOptions) => Promise<string>
import { downloadMarkdown } from 'nocean'
const result = await downloadMarkdown({
token: '<TOKEN>',
blockId: '<BLOCK_ID>',
outputDirPath: 'notion/',
})
console.log(result)
// /Users/foo/bar/baz/notion