https://github.com/jdan/notion-augment
Augment a Notion database on command
https://github.com/jdan/notion-augment
Last synced: 3 months ago
JSON representation
Augment a Notion database on command
- Host: GitHub
- URL: https://github.com/jdan/notion-augment
- Owner: jdan
- Created: 2021-09-10T14:09:30.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-12T01:01:33.000Z (almost 5 years ago)
- Last Synced: 2024-04-14T15:18:46.648Z (about 2 years ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## notion-augment
Augment your [Notion](https://notion.so) databases on command, à la [Man-Computer Symbiosis](https://en.wikipedia.org/wiki/Man-Computer_Symbiosis).
### usage
```js
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 },
},
],
},
};
}
);
```
