JSPM

@narkdown/notion-parser

0.6.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q48619F
  • License MIT

Parse notion response

Package Exports

  • @narkdown/notion-parser
  • @narkdown/notion-parser/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@narkdown/notion-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@narkdown/notion-parser

Generate massive amounts of fake contextual data for Notion

codecov XO code style Version: v0.5.0 license: MIT

Install

$ npm install @narkdown/notion-parser

Usage

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);

API

const notionParser = new NotionParser(options?)

options

Type: object

propertyOptions

Type: object

date

notionParser.database.getRows(results)

results

results field of Query a database response

Support

Database Object

Property Supported
object
id
created_time
last_edited_time
title
icon
cover
properties ⚠️
parent
url

Property Object

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

Page Object

Property Supported
object
id
created_time
last_edited_time
archived
icon
cover
properties
parent
url

License

MIT