{"id":20529141,"url":"https://github.com/getindiekit/mf2tojf2","last_synced_at":"2025-07-03T08:08:04.106Z","repository":{"id":39307631,"uuid":"282540784","full_name":"getindiekit/mf2tojf2","owner":"getindiekit","description":"Convert MF2 to JF2.","archived":false,"fork":false,"pushed_at":"2024-12-02T22:10:40.000Z","size":618,"stargazers_count":7,"open_issues_count":3,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-14T20:18:23.510Z","etag":null,"topics":["jf2","mf2","microformats"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/getindiekit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"getindiekit"}},"created_at":"2020-07-25T23:19:20.000Z","updated_at":"2025-04-20T05:21:38.000Z","dependencies_parsed_at":"2022-09-12T11:32:55.642Z","dependency_job_id":"cb147c24-b978-4abd-a74c-2a1da3c90ac0","html_url":"https://github.com/getindiekit/mf2tojf2","commit_stats":null,"previous_names":["paulrobertlloyd/mf2tojf2"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/getindiekit/mf2tojf2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindiekit%2Fmf2tojf2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindiekit%2Fmf2tojf2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindiekit%2Fmf2tojf2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindiekit%2Fmf2tojf2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getindiekit","download_url":"https://codeload.github.com/getindiekit/mf2tojf2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindiekit%2Fmf2tojf2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259877838,"owners_count":22925459,"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":["jf2","mf2","microformats"],"created_at":"2024-11-15T23:29:29.038Z","updated_at":"2025-07-03T08:08:04.078Z","avatar_url":"https://github.com/getindiekit.png","language":"JavaScript","funding_links":["https://github.com/sponsors/getindiekit"],"categories":[],"sub_categories":[],"readme":"# MF2 to JF2\n\n[![Build status](https://github.com/getindiekit/mf2tojf2/workflows/build/badge.svg)](https://github.com/getindiekit/mf2tojf2/actions)\n\nConvert [MF2](https://microformats.org/wiki/microformats2-parsing) to [JF2](https://jf2.spec.indieweb.org).\n\nJF2 is a simpler JSON serialization of microformats2 intended to be easier to consume than the standard [microformats JSON representation](https://microformats.org/wiki/microformats2).\n\n## Requirements\n\n- [Node.js](https://nodejs.org) v18.18+\n\n## Usage\n\n### Simple (synchronous)\n\n```js\nimport { mf2tojf2 } from \"mf2tojf2\";\n\nconst mf2 = {\n  items: [\n    {\n      type: [\"h-card\"],\n      properties: {\n        name: [\"Paul Robert Lloyd\"],\n        url: [\"https://paulrobertlloyd.com\"],\n      },\n    },\n  ],\n};\n\nconst jf2 = mf2tojf2(mf2);\n\nconsole.log(jf2);\n```\n\nReturns:\n\n```js\n{\n  type: \"card\",\n  name: \"Paul Robert Lloyd\",\n  url: \"https://paulrobertlloyd.com\"\n}\n```\n\n### With references (asynchronous)\n\nJF2 can include [a `references` property](https://jf2.spec.indieweb.org/#using-references) to exclude any non-authoritative data from the defined object.\n\n```js\nimport { mf2tojf2referenced } from \"mf2tojf2\";\n\nconst mf2 = {\n  items: [\n    {\n      type: [\"h-entry\"],\n      properties: {\n        name: [\"What my friend ate for lunch yesterday\"],\n        published: [\"2019-02-12T10:00:00.000+00:00\"],\n        url: [\"https://my-website.example/bookmarks/lunch\"],\n        \"bookmark-of\": [\"https://their-website.example/notes/lunch\"],\n        \"mp-syndicate-to\": \"https://example.social/@username\",\n      },\n    },\n  ],\n};\n\nconst jf2WithReferences = await mf2tojf2referenced(mf2);\n\nconsole.log(jf2WithReferences);\n```\n\nReturns:\n\n```js\n{\n  type: \"entry\",\n  name: \"What my friend ate for lunch yesterday\",\n  published: \"2019-02-12T10:00:00.000+00:00\",\n  url: \"https://my-website.example/bookmarks/lunch\",\n  \"bookmark-of\": \"https://their-website.example/notes/lunch\",\n  \"mp-syndicate-to\": \"https://example.social/@username\",\n  references: {\n    \"https://their-website.example/notes/lunch\": {\n      type: \"entry\",\n      name: \"What I ate for lunch\",\n      published: \"2019-01-12T15:55:00.000+00:00\",\n      url: \"https://their-website.example/notes/lunch\",\n      content: {\n        text: \"I ate a cheese sandwich, which was nice.\",\n        html: \"\u003cp\u003eI ate a cheese sandwich, which was nice.\u003c/p\u003e\"\n      },\n      category: [\"Food\", \"Lunch\", \"Sandwiches\"]\n    }\n  }\n}\n```\n\n\u003e [!NOTE]\\\n\u003e Values for `audio`, `photo`, `url`, `video` and any property prefixed with `mp-`, are excluded from referencing.\n\n## Testing\n\n`npm test`\n\n## Releasing a new version\n\n`npm run release`\n\n## Credits\n\nBased on [mf2tojf2.py](https://github.com/microformats/mf2tojf2.py).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetindiekit%2Fmf2tojf2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetindiekit%2Fmf2tojf2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetindiekit%2Fmf2tojf2/lists"}