1.4.4 • Published 6 months ago

@texonom/cli v1.4.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Texonom Notion CLI

Robust TypeScript client for the unofficial Notion API.

NPM Build Status Prettier Code Formatting

Install

pnpm i @texonom/cli

Usages

Export

## export block, collection, collection_view and notion_user for each folder
pnpm tsx src/main.ts export --raw

Develop

import { NotionExporter } from '@texonom/cli'

const exporter = new NotionExporter({ page: pageId })
const recordMap = await exporter.notion.getPage(pageId)
const md = await exporter.pageToMarkdown(parsePageId(pageId), recordMap)

Example

Export whole workspace

# 1. First get all raw data from the Notion API
pnpm tsx src/main.ts export -p 04089c8ae3534bf79512fc495944b321 --raw -r -f

# 2. After that transform all raw data to markdown
# it requres Notion token if there are missed blocks & spaces & users & collections (No ~ query)
export NOTION_TOKEN=
pnpm tsx src/main.ts export -p 04089c8ae3534bf79512fc495944b321 -r -l -t $NOTION_TOKEN -u
# 3. If there is a rate limit error try without token for anonymous request
pnpm tsx src/main.ts export -p 04089c8ae3534bf79512fc495944b321 -r -l -u
# Iterate the 2-3 commands until collection error is gone (due to the rate limit)

if there is memory error

NODE_OPTIONS="--max-old-space-size=16384" tsx ...

Export a single page

pnpm tsx src/main.ts export -p 04089c8ae3534bf79512fc495944b321
1.4.4

6 months ago

1.4.3

6 months ago

1.4.2

6 months ago

1.4.1

8 months ago

1.4.0

8 months ago

1.3.1

8 months ago

1.3.0

1 year ago

1.3.0-beta.0

1 year ago

1.2.12

1 year ago

1.2.11

2 years ago

1.2.10

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.2.0-alpha.0

2 years ago