1.0.10 • Published 3 years ago

@eliwimmer/notion-api-tools v1.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

A simple set of tools to help with handling Notion API responses.

Install:

npm i @eliwimmer/notion-api-tools

dbQuerySimple()

Returns an array with only the id and page title from a Query Database response. Pages without a title are returned as a string 'Unititled' to avoid undefined errors when using map or other looping methods. Page titles in a database query are deeply nested, and have a dynamic index and key. This script makes getting that info easy, without having to make an API call for each page int the results.

Usage:

const dbQuerySimple = require('@eliwimmer/notion-api-tools')

dbQuerySimple(response)

Returns:

[
{ id: 'Page ID', title: 'Page Name'},
{ id: 'Page ID', title: 'Untitled' },
{ id: 'Page ID', title: 'Page Name' },
{ id: 'Page ID', title: 'Page Name' }
]
1.0.9

3 years ago

1.0.8

3 years ago

1.0.10

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago