Generate massive amounts of fake contextual data for Notion
$ npm install @narkdown/notion-parser
const {Client} = require('@notionhq/client');
const {NotionParser} = require('@narkdown/notion-parser');
const NOTION_API_KEY = ''; // Notion API Key
const DATABASE_ID = ''; // Database ID
const notion = new Client({auth: NOTION_API_KEY});
const notionParser = new NotionParser({
propertyOptions: {
date: {
timeZone: 'Asia/Seoul',
format: 'yyyy-MM-dd HH:mm:ss',
},
},
});
const {results} = await notion.databases.query({
database_id: DATABASE_ID,
});
const rows = notionParser.database.getRows(results);
console.log(rows);
Type: object
Type: object
timeZone
(string
): time zone name (Default:Asia/Seoul
)format
(string
) : Date format patterns (Default:yyyy-MM-dd HH:mm:ss
)
results field of Query a database response
Property | Supported |
---|---|
object |
❌ |
id |
❌ |
created_time |
❌ |
last_edited_time |
❌ |
title |
❌ |
icon |
❌ |
cover |
❌ |
properties |
|
parent |
❌ |
url |
❌ |
Property | Supported |
---|---|
title |
✅ |
rich_text |
✅ |
number |
✅ |
select |
✅ |
multi_select |
✅ |
date |
✅ |
files |
❌ |
checkbox |
✅ |
url |
✅ |
email |
✅ |
phone_number |
✅ |
formula |
❌ |
relation |
❌ |
rollup |
❌ |
people |
❌ |
created_by |
❌ |
created_time |
✅ |
last_edited_by |
❌ |
last_edited_time |
✅ |
Property | Supported |
---|---|
object |
❌ |
id |
❌ |
created_time |
❌ |
last_edited_time |
❌ |
archived |
❌ |
icon |
❌ |
cover |
❌ |
properties |
❌ |
parent |
❌ |
url |
❌ |