File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 1
- import { NotionToMarkdown } from ' notion-to-md'
2
- import { Client } from ' @notionhq/client'
1
+ import { NotionToMarkdown } from " notion-to-md" ;
2
+ import { Client } from " @notionhq/client" ;
3
3
4
- export default async function notion2md ( pageId : string , token : string ) : Promise < string > {
4
+ export default async function notion2md (
5
+ pageId : string ,
6
+ token : string
7
+ ) : Promise < string > {
5
8
const notion = new Client ( {
6
- auth : token
7
- } )
9
+ auth : token ,
10
+ } ) ;
8
11
9
12
const n2m = new NotionToMarkdown ( {
10
13
notionClient : notion ,
11
14
config : {
12
15
parseChildPages : false , // default: parseChildPages
13
- }
16
+ } ,
14
17
} ) ;
15
18
16
19
const mdblocks = await n2m . pageToMarkdown ( pageId ) ;
17
20
const mdString = await n2m . toMarkdownString ( mdblocks ) ;
18
21
return mdString . parent ;
19
-
20
- }
22
+ }
You can’t perform that action at this time.
0 commit comments