notase
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

notase

Easily use a Notion table as a database.

Installation

const { getDataFromNotion } = require('notase');

getDataFromNotion('YOUR API TOKEN', 'YOUR DATABASE ID')
  .then((data) => {
    // data will be all the rows in your table, an array of objects with each column as a property
  });

Parsers

Default parsers are provided for the main data types (title, rich_text, multi_select, number, url, files) but can be customized if a third argument is passed.

This is in no way exhaustive and is mainly what's needed for personal use, so feel free to use your own column parsers.

Methods

getDataFromNotion(notionApiToken, notionDatabaseId, [parsers]) ⇒ Promise.<Array.<T>>

Gets all the desired database data from Notion. It will read all pages until the full table is ready and return the parsed content.

Kind: global function
Returns: Promise.<Array.<T>> - The parsed database results

Param Type Default Description
notionApiToken string Notion's API token
notionDatabaseId string Notion database ID to get results from
[parsers] Record.<string, function()> Parsers The custom parsers for your needs

Package Sidebar

Install

npm i notase

Weekly Downloads

4

Version

0.2.0

License

MIT

Unpacked Size

23 kB

Total Files

11

Last publish

Collaborators

  • alrico88