notion-augment

1.0.0 • Public • Published

notion-augment

Augment your Notion databases on command, à la Man-Computer Symbiosis.

usage

const augment = require("notion-augment");

require("dotenv").config();

function concatenateTitle(arr) {
  return arr.map((i) => i.text.content).join("");
}

augment(
  {
    token: process.env.NOTION_TOKEN,
    database: process.env.NOTION_DATABASE_ID,
    sorts: [],
  },
  (row) => {
    const seed = concatenateTitle(row.properties.Seed.title);
    const url = `https://hashpng.jordanscales.com/circles/685/360/${seed}.png`;
    // https://developers.notion.com/reference/patch-page
    return {
      Art: {
        files: [
          {
            type: "external",
            name: `${seed}.png`,
            external: { url },
          },
        ],
      },
    };
  }
);

augment

Readme

Keywords

Package Sidebar

Install

npm i notion-augment

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.86 kB

Total Files

5

Last publish

Collaborators

  • prezjordan