New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

get-notion-object-title

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-notion-object-title

get human readable names from Notion objects.

latest
Source
npmnpm
Version
0.2.8
Version published
Maintainers
1
Created
Source

Get Notion Object Title

The Notion API does not provide a simple way to retrieve the title of an object. This module provides you with a simple API where you can pass in a Notion Object and receive a human readable string.

Install

npm i get-notion-object-title

Usage

import getNotionObjectTitle from 'get-notion-object-title';

getNotionObjectTitle(yourBlock); // returns "Human readable block title"

Disable emoji

If you already have a way to handle icons and would like to only get the text, you can disable the emojis by passing in an option.

getNotionObjectTitle(yourBlock, { emoji: false }); // returns "Human readable block title"

How does it work?

The getNotionObjectTitle takes a Notion object as input and returns a string. Depending on the type of the object there are some rules that are applied.

Page

If the page has any of the following properties they will be used and they do exclude each other:

  • Title
  • Page
  • Name

Database

The database uses the top level title attribute.

Other

The remaining blocks are converted to plain text using the rich text items.

License

Unless otherwise specified in the source:

The code is licensed under the MIT Copyright (c) 2023, Alexander Alemayhu.

Keywords

notion

FAQs

Package last updated on 05 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts