{"_id":"@plugdash/fromghost","_rev":"5-adf9518cec2f769e8d02ecf03012bf23","name":"@plugdash/fromghost","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@plugdash/fromghost","version":"0.1.0","keywords":["emdash","emdash-plugin","fromghost","ghost","import"],"license":"MIT","_id":"@plugdash/fromghost@0.1.0","maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"homepage":"https://github.com/plugdash/plugdash#readme","bugs":{"url":"https://github.com/plugdash/plugdash/issues"},"dist":{"shasum":"1ce8748e5173c83bc59327be028a88220c9c5146","tarball":"https://registry.npmjs.org/@plugdash/fromghost/-/fromghost-0.1.0.tgz","fileCount":2,"integrity":"sha512-E9K3yfDZgW9WqbrEe59/r1E01co97meVnOBubmPOxTpHBLy4k1fSXmqCBbto+smAni6yjSGLnX4ZSlmAIEExhA==","signatures":[{"sig":"MEYCIQCPbOJbnC0km8ysDx2gq4j2txm2Qq1Rctl0c74NCR67QAIhAPIFIZkU7FjY1nfSAZGAC1qbtHuDPa8hc7D1tW1E7fom","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6026},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"gitHead":"b25b6667c81891ddea3b04b2ef9a675e4697ddf2","scripts":{"lint":"oxlint .","test":"vitest run","build":"tsdown src/index.ts --dts.eager","typecheck":"tsc --noEmit"},"_npmUser":{"name":"abhinav061","email":"abhinav061@gmail.com"},"deprecated":"broken publish, use 0.1.1","repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/fromghost"},"_npmVersion":"12.1.0","description":"Import a Ghost JSON export into EmDash","directories":{},"_nodeVersion":"24.21.0","dependencies":{"@plugdash/html-to-portable-text":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","@plugdash/types":"workspace:*"},"peerDependencies":{"emdash":">=0.13.0"},"_npmOperationalInternal":{"tmp":"tmp/fromghost_0.1.0_1790399761460_0.17675206579216396","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@plugdash/fromghost","version":"0.1.1","keywords":["emdash","emdash-plugin","fromghost","ghost","import"],"license":"MIT","_id":"@plugdash/fromghost@0.1.1","maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"homepage":"https://github.com/plugdash/plugdash#readme","bugs":{"url":"https://github.com/plugdash/plugdash/issues"},"dist":{"shasum":"9145fcaf71ea35d092b8be5ea7abea0bc0714e34","tarball":"https://registry.npmjs.org/@plugdash/fromghost/-/fromghost-0.1.1.tgz","fileCount":7,"integrity":"sha512-PIBDy1SfisHzMJgfvJJN/ADOQpZeULMg3gKFDCyp5du0dB3dJyR1/msG+U0nXxPKLgiS8BVObRDbUKwyDITR0Q==","signatures":[{"sig":"MEYCIQCaDwo08OHK0sl9mQyWq+e13xN7xMy716lsnGJKu2Ll2AIhAJT5/PLl/3M/W5UPBKVuWVsLt5Unsl5pxdYeph5k4jS6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCICtmkXTHKCpwcULClJMWCY2pU5/a6+fEdekxMvxmaLsKAiEA/owfvFeA7sPOvVNRl+JLCTF9+EpWJzzj4LLKJDuIQhw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@plugdash%2ffromghost@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":97215},"main":"./dist/index.mjs","type":"module","_from":"file:plugdash-fromghost-0.1.1.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"scripts":{"lint":"oxlint .","test":"vitest run","build":"tsdown src/index.ts --dts.eager","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e1a50afe-2a31-4135-8913-d33586af7853"}},"_resolved":"/tmp/2836cc0f1cf4605b24ff985a7fab2f3a/plugdash-fromghost-0.1.1.tgz","_integrity":"sha512-PIBDy1SfisHzMJgfvJJN/ADOQpZeULMg3gKFDCyp5du0dB3dJyR1/msG+U0nXxPKLgiS8BVObRDbUKwyDITR0Q==","repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/fromghost"},"_npmVersion":"11.5.1","description":"Import a Ghost JSON export into EmDash","directories":{},"_nodeVersion":"22.23.2","dependencies":{"linkedom":"^0.18.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","@plugdash/types":"0.0.0","@plugdash/html-to-portable-text":"0.0.0"},"peerDependencies":{"emdash":">=0.13.0"},"_npmOperationalInternal":{"tmp":"tmp/fromghost_0.1.1_1790404195202_0.23524400394571265","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@plugdash/fromghost","version":"0.1.2","keywords":["emdash","emdash-plugin","fromghost","ghost","import"],"license":"MIT","_id":"@plugdash/fromghost@0.1.2","maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"homepage":"https://github.com/plugdash/plugdash#readme","bugs":{"url":"https://github.com/plugdash/plugdash/issues"},"dist":{"shasum":"cedfe19156e50eb7b734aa95250ea17e00f7b87b","tarball":"https://registry.npmjs.org/@plugdash/fromghost/-/fromghost-0.1.2.tgz","fileCount":7,"integrity":"sha512-BnGlYiGtVpzCVe6FR+UDe5RP8of0oEgXVtukeY9EretfAJ9gvSB6dXJYtSx4QmOBk4xzMbsFhUgjZCHH4y7RmQ==","signatures":[{"sig":"MEYCIQD4zmVr/ljoVR8DxJJG2gXz9AsIMiPdEFrbRniLd0TiPwIhAIet4wr+F74DyvgiV+vI8X/1KfnFcKE/7Np4eU7Zh/Hk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIE8jGDl1CEDdXao7FWSenk3In+2+P72k/oUQ5COmic43AiApW3MCm8yOUcBctOVRx7xvHWmzgxwz2cd+KqyD1e4Eyw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@plugdash%2ffromghost@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":97307},"main":"./dist/index.mjs","type":"module","_from":"file:plugdash-fromghost-0.1.2.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"scripts":{"lint":"oxlint .","test":"vitest run","build":"tsdown src/index.ts --dts.eager","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e1a50afe-2a31-4135-8913-d33586af7853"}},"_resolved":"/tmp/8380eef4bf3d73db9de36987fde5a06d/plugdash-fromghost-0.1.2.tgz","_integrity":"sha512-BnGlYiGtVpzCVe6FR+UDe5RP8of0oEgXVtukeY9EretfAJ9gvSB6dXJYtSx4QmOBk4xzMbsFhUgjZCHH4y7RmQ==","repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/fromghost"},"_npmVersion":"11.5.1","description":"Import a Ghost JSON export into EmDash","directories":{},"_nodeVersion":"22.23.2","dependencies":{"linkedom":"^0.18.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","@plugdash/types":"0.0.0","@plugdash/html-to-portable-text":"0.0.0"},"peerDependencies":{"emdash":">=0.13.0"},"_npmOperationalInternal":{"tmp":"tmp/fromghost_0.1.2_1790409378933_0.6201203077278485","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"_id":"@plugdash/fromghost@0.2.0","bugs":{"url":"https://github.com/plugdash/plugdash/issues"},"dist":{"shasum":"e974c40c39947ff1cc8311f96d99fb54013ae863","tarball":"https://registry.npmjs.org/@plugdash/fromghost/-/fromghost-0.2.0.tgz","fileCount":9,"integrity":"sha512-nYc7e2yxuNQP0UKcELc/LnH1Xds3ltwq0xyKBo9gPTFd+0WU0WxQREn9GbX4L0T9RJCYcNbKwAPb1Cj5V5G4xQ==","signatures":[{"sig":"MEUCIQCDZa1AC8cL4v6yIDE2qmHrQy3HAJbMYymtGmtXGNuNVAIgDkhkyzETVUgiRrk5RkeZL/Gxe8ApIaNc4I02Fjc21GQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC/BeFDT8g+Duc/9BaknOrQAILGX71zYr1pqf+HjEmyewIgAZ/zd1zfMmsr1P3n78gmFznkdevG5b4T31qb8CdXktk="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@plugdash%2ffromghost@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":111551},"main":"./dist/index.mjs","name":"@plugdash/fromghost","type":"module","_from":"file:plugdash-fromghost-0.2.0.tgz","types":"./dist/index.d.mts","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs"}},"license":"MIT","scripts":{"lint":"oxlint .","test":"vitest run","build":"tsdown src/index.ts --dts.eager","typecheck":"tsc --noEmit"},"version":"0.2.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"e1a50afe-2a31-4135-8913-d33586af7853"}},"homepage":"https://github.com/plugdash/plugdash#readme","keywords":["emdash","emdash-plugin","fromghost","ghost","import"],"_resolved":"/tmp/0a1f53c52c047e37b5d0380e56addd8c/plugdash-fromghost-0.2.0.tgz","_integrity":"sha512-nYc7e2yxuNQP0UKcELc/LnH1Xds3ltwq0xyKBo9gPTFd+0WU0WxQREn9GbX4L0T9RJCYcNbKwAPb1Cj5V5G4xQ==","repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/fromghost"},"_npmVersion":"11.5.1","description":"Import a Ghost JSON export into EmDash","directories":{},"maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"_nodeVersion":"22.23.3","dependencies":{"linkedom":"^0.18.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","@plugdash/types":"0.0.0","@plugdash/html-to-portable-text":"0.0.0"},"peerDependencies":{"emdash":">=0.13.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fromghost_0.2.0_1790936840507_0.2974235633489568"}}},"time":{"created":"2026-09-26T05:16:01.292Z","modified":"2026-10-02T10:27:20.989Z","0.1.0":"2026-09-26T05:16:01.586Z","0.1.1":"2026-09-26T06:29:55.276Z","0.1.2":"2026-09-26T07:56:19.024Z","0.2.0":"2026-10-02T10:27:20.585Z"},"bugs":{"url":"https://github.com/plugdash/plugdash/issues"},"license":"MIT","homepage":"https://github.com/plugdash/plugdash#readme","keywords":["emdash","emdash-plugin","fromghost","ghost","import"],"repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/fromghost"},"description":"Import a Ghost JSON export into EmDash","maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"readme":"# @plugdash/fromghost\n\nImports a Ghost JSON export (Settings > Labs > Export your content) into EmDash.\nRegisters a Ghost import source with EmDash's import registry, so posts, pages,\ntags and authors go through EmDash's own media download, taxonomy and\ncontent-creation pipeline.\n\nEmDash's admin import screen only lists WordPress sources, so \"Ghost Export\nFile\" does not appear there. Run the import through a script or the import\nAPI. Remove the plugin after the import.\n\n## Install\n\n```bash\npnpm add @plugdash/fromghost\n```\n\n## Register\n\n```js\n// astro.config.mjs\nimport { defineConfig } from \"astro/config\";\nimport emdash from \"emdash/astro\";\nimport { fromghostPlugin } from \"@plugdash/fromghost\";\n\nexport default defineConfig({\n\tintegrations: [\n\t\temdash({\n\t\t\tplugins: [fromghostPlugin({ siteUrl: \"https://blog.example.com\" })],\n\t\t}),\n\t],\n});\n```\n\nOptions are passed to `createPlugin(options)` in the server runtime, so they\nare active in a production build.\n\n## Config options\n\nPassed to `fromghostPlugin({ ... })`:\n\n| Option           | Type                             | Default   | Description                                                                                                                                                                         |\n| ---------------- | -------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| targetCollection | `string`                         | `\"posts\"` | Collection suggested for Ghost posts                                                                                                                                                |\n| status           | n/a                              | -         | Not configurable - status comes from each post's own Ghost status (see below)                                                                                                       |\n| preserveSlugs    | `boolean`                        | `true`    | Keep Ghost's slugs instead of regenerating from title                                                                                                                               |\n| importImages     | `boolean`                        | `true`    | Carry feature and inline images over                                                                                                                                                |\n| importTags       | `boolean`                        | `true`    | Carry Ghost tags over as taxonomy terms                                                                                                                                             |\n| siteUrl          | `string`                         | `\"\"`      | The Ghost site's URL, to resolve `__GHOST_URL__` image paths                                                                                                                        |\n| paidPostsAs      | `\"draft\" \\| \"publish\" \\| \"skip\"` | `\"draft\"` | Posts with Ghost visibility `members`, `paid` or `tiers`. The export holds their full body, so the default keeps them off the public site. `meta.visibility` is recorded either way |\n\n`siteUrl` matters: Ghost writes images and links as `__GHOST_URL__/...`\nrather than an absolute URL. With `siteUrl` set, every placeholder in the\npost HTML is replaced before conversion, and inline images are listed in the\nanalysis attachments so EmDash downloads them. Without it, site-relative\nfeature images are skipped (the import continues without them).\n\nRecoverable problems (Lexical-only drafts, duplicate slugs, unresolved images)\nare returned as `warnings` on the analysis. emdash 1.0.1's `ImportAnalysis`\ntype has no warnings field, so this is an extra property on the object.\n\nImport status (draft vs. published) is not a plugin setting - it is read\nstraight from each post's own Ghost status via `fetchContent`'s\n`includeDrafts` option, which EmDash's import screen controls.\n\n## Field mapping\n\n| Ghost field                                 | EmDash field                                       |\n| ------------------------------------------- | -------------------------------------------------- |\n| `title`                                     | `title`                                            |\n| `slug`                                      | `slug` (or regenerated, see `preserveSlugs`)       |\n| `html`                                      | `content`, via `htmlToPortableText`                |\n| `custom_excerpt` (falls back to `excerpt`)  | `excerpt`                                          |\n| `feature_image`                             | `featuredImage` (after `__GHOST_URL__` resolution) |\n| `published_at` (falls back to `created_at`) | `date`                                             |\n| `updated_at`                                | `modified`                                         |\n| `meta_title`                                | `meta.seoTitle`                                    |\n| `meta_description`                          | `meta.seoDescription`                              |\n| tags via `posts_tags`                       | `tags` (public tags only)                          |\n| author via `posts_authors`                  | `author` (first author's slug)                     |\n\n## What it does\n\n- Parses Ghost's `{ db: [{ meta, data }] }` export shape, and the looser\n  `{ data }` / `{ posts }` shapes some third-party exporters use\n- Handles both Ghost 5 (`type: \"post\" | \"page\"`) and Ghost 4 (`page: boolean`)\n  post-type flags\n- Converts post body HTML to Portable Text via the same shared\n  `@plugdash/html-to-portable-text` converter `fromsubstack` uses\n- Falls back to a plain-text recovery of Ghost 5 Lexical drafts that were\n  never rendered to HTML (`html: null`), and warns when it does\n- Resolves tags and the primary author through the `posts_tags` /\n  `posts_authors` join tables, in Ghost's own sort order\n- Skips duplicate slugs (keeping the first occurrence) and warns\n- Skips a feature image that cannot be resolved to an absolute URL and warns,\n  rather than failing the whole post\n- Reports post/page counts, tag counts, attachment counts (feature and inline\n  images) and warnings through `ImportAnalysis`\n- Loads the HTML converter (and `linkedom`) only when an import runs, so\n  having the plugin registered costs nothing at startup\n\n## What it does not do\n\n- Does not convert Mobiledoc (Ghost 3 and older editor format) - such posts\n  import with an empty body and a warning\n- Does not download or upload media itself - `featuredImage` is handed to\n  EmDash's import pipeline as a URL, which owns the actual download\n- Does not import Ghost members, newsletters, or comments\n- Does not preserve Ghost's internal tags (`visibility: \"internal\"`) as\n  taxonomy - those are Ghost's own bookkeeping\n- Cannot be sandboxed - it registers directly into EmDash's import-source registry\n- Does not appear in the admin import screen (WordPress only in emdash 1.0.1)\n","readmeFilename":"README.md"}