This script import markdown notes to Notion
nodejs
PostgresQL
- for local cache of imported notes
- Create db and table
imported_notes
using scriptdb.sql
sudo -u postgres createdb notion-test
sudo -u postgres psql -d notion-test -f db.sql
-
Get
NOTION_TOKEN
and give access to your note where the data will be imported -
Run the script specifying the folder with markdown notes
export NOTION_TOKEN 'secret_notion_token'
export DB_HOST 'localhost'
export DB_NAME 'notion'
export DB_USER 'notion'
export DB_PASSWORD 'notion-password'
node index.js --import /path/to/notes
- Some notes may not import correctly. Solutions
node index.js --show-errors
- After correcting the original notes that were imported with an error, they can be imported again
node index.js --import-with-errors /path/no/notes