{"id":13907782,"url":"https://github.com/konojunya/notion-markdown","last_synced_at":"2025-03-20T05:30:35.306Z","repository":{"id":40833795,"uuid":"263491056","full_name":"konojunya/notion-markdown","owner":"konojunya","description":"Parse the Notion page as a Markdown","archived":false,"fork":false,"pushed_at":"2023-01-06T05:47:23.000Z","size":433,"stargazers_count":35,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T15:08:07.374Z","etag":null,"topics":["markdown","notion","notion-markdown","parser"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/konojunya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-13T01:10:13.000Z","updated_at":"2025-01-28T07:41:04.000Z","dependencies_parsed_at":"2023-02-05T11:16:22.907Z","dependency_job_id":null,"html_url":"https://github.com/konojunya/notion-markdown","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konojunya%2Fnotion-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konojunya%2Fnotion-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konojunya%2Fnotion-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konojunya%2Fnotion-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konojunya","download_url":"https://codeload.github.com/konojunya/notion-markdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244056329,"owners_count":20390719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","notion","notion-markdown","parser"],"created_at":"2024-08-06T23:02:10.301Z","updated_at":"2025-03-20T05:30:35.028Z","avatar_url":"https://github.com/konojunya.png","language":"TypeScript","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# notion-markdown\n\nParse the Notion page as a Markdown\n\n## Installation\n\n```bash\n$ yarn add notion-markdown\n```\n\n## Usage\n\n```js\nimport notion from 'notion-markdown';\nimport fetch from 'node-fetch';\n\nfetch('https://www.notion.so/api/v3/loadPageChunk', {\n  method: 'POST',\n  headers: {\n    'Content-Type': 'application/json',\n    cookie: `token_v2=\u003cyour cookie\u003e`,\n  },\n  body: JSON.stringify({\n    pageId: \u003cyour blog page id(if the id is 32 characters, it is still not normalized)\u003e,\n    limit: 50, // notion default setting,\n    cursor: { stack: [] },\n    chunkNumber: 0,\n    verticalColumns: false,\n  })\n}).then(res =\u003e res.json()).then(res =\u003e {\n  // Please put the contents of `res.recordMap.block` in the notion function.\n  console.log(notion(Object.values(res.recordMap.block)));\n});\n```\n\n## API\n\n### `notion`\n\n```typescript\nfunction notion(blocks: Block[]): string;\n```\n\nThe Block has the following structure.\n\n```typescript\ntype Block = {\n  role: string;\n  value: {\n    id: string;\n    type: string;\n    properties?: any;\n  };\n};\n```\n\n## CHANGELOG\n\nSee [CHANGELOG.md](https://github.com/konojunya/notion-markdown/blob/master/CHANGELOG.md).\n\n## Contributing\n\nwelcoming your contribution 👏\n\n1. Fork\n2. Create a feature branch\n3. Run test suite with the `$ yarn test` command and confirm that it passes\n4. Commit your changes\n5. Rebase your local changes against the `master` branch\n6. Create new Pull Request 🎉\n\nBugs, feature requests and comments are more than welcome in the [issues](https://github.com/konojunya/notion-markdown/issues).\n\n### Development scripts\n\n#### `yarn test`\n\nRun Unit test with Jest.\n\n```bash\n$ yarn test\n```\n\n#### `yarn lint`\n\nRun lint with ESLint.\n\n```bash\n$ yarn lint\n```\n\n#### `yarn format`\n\nRun formatting with ESLint (--fix) and Prettier.\n\n```bash\n$ yarn format\n```\n\n### License\n\n[MIT](https://github.com/konojunya/notion-markdown/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonojunya%2Fnotion-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonojunya%2Fnotion-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonojunya%2Fnotion-markdown/lists"}