{"_id":"@plugdash/fromsubstack","_rev":"5-da9af9799aea5321948a55abdfee2573","name":"@plugdash/fromsubstack","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@plugdash/fromsubstack","version":"0.1.0","keywords":["emdash","emdash-plugin","substack","import","migration"],"license":"MIT","_id":"@plugdash/fromsubstack@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":"1a49fbdad46f914baba63095b1f6274684cb32fd","tarball":"https://registry.npmjs.org/@plugdash/fromsubstack/-/fromsubstack-0.1.0.tgz","fileCount":2,"integrity":"sha512-cpdw0ptiDvB0FTZBhfERVIuhBXSUaac3X53PQCEPBk7HxVtUm4gm38J0tfYzDA1tuH4ybRHkhV4qQIJeH0APYw==","signatures":[{"sig":"MEUCIBExeUcPrItlLiM/JFfSYZGqGy4IBsehs2on1uT5IBSPAiEA2ae11o4clpi3koyToAaX3E7Ry6waZ1fM06E/3HV/W9c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4459},"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/fromsubstack"},"_npmVersion":"12.1.0","description":"Import a Substack export into EmDash - posts, metadata, and images","directories":{},"_nodeVersion":"24.21.0","dependencies":{"fflate":"^0.8.2","linkedom":"^0.18.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","@plugdash/types":"workspace:*","@plugdash/html-to-portable-text":"workspace:*"},"peerDependencies":{"emdash":">=0.13.0"},"_npmOperationalInternal":{"tmp":"tmp/fromsubstack_0.1.0_1790399768480_0.04961397507496024","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@plugdash/fromsubstack","version":"0.1.1","keywords":["emdash","emdash-plugin","substack","import","migration"],"license":"MIT","_id":"@plugdash/fromsubstack@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":"47e4b29a7e495f9089f5dc0905429a5986c7553d","tarball":"https://registry.npmjs.org/@plugdash/fromsubstack/-/fromsubstack-0.1.1.tgz","fileCount":7,"integrity":"sha512-MEwfRI3PrJlF65mJRhf0eF5igPSZ3QMyufgRWV5fwhB7Pwevyw1SICzwk8L4KTfooc51mQRb4T5fqMxSbv4Vpg==","signatures":[{"sig":"MEYCIQD1DKNlgY4OdLAkuag6DvqlV8j+cbQquWRgNaqDlzGdNQIhAMUCzeBbzfmrrpIVKZ1gpwbGjzL004DaXe0Oow7/UxRi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDQpZFODGDq2m3ME7TzhhCBZRsdQ/PPC8OymHWKL9Yx9gIgVtM0Zmi2ryGBD87JPqnJLGdT61hri0ZfKjgKA0zLm9I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@plugdash%2ffromsubstack@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":66689},"main":"./dist/index.mjs","type":"module","_from":"file:plugdash-fromsubstack-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:ff9c926e-e108-4835-9f7f-bba4bbb6baf5"}},"_resolved":"/tmp/c07cb3542f9f07c41ac06a5404a6eb5b/plugdash-fromsubstack-0.1.1.tgz","_integrity":"sha512-MEwfRI3PrJlF65mJRhf0eF5igPSZ3QMyufgRWV5fwhB7Pwevyw1SICzwk8L4KTfooc51mQRb4T5fqMxSbv4Vpg==","repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/fromsubstack"},"_npmVersion":"11.5.1","description":"Import a Substack export into EmDash - posts, metadata, and images","directories":{},"_nodeVersion":"22.23.2","dependencies":{"fflate":"^0.8.2","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/fromsubstack_0.1.1_1790404266573_0.4200583035329759","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@plugdash/fromsubstack","version":"0.1.2","keywords":["emdash","emdash-plugin","substack","import","migration"],"license":"MIT","_id":"@plugdash/fromsubstack@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":"f3545e9b931dd1636016740e1cac5f23e054508e","tarball":"https://registry.npmjs.org/@plugdash/fromsubstack/-/fromsubstack-0.1.2.tgz","fileCount":7,"integrity":"sha512-gUXGFzR98Adb/6TJoD+DQQS4uWx2P4clReKzEYf/dq/eXnK3+99OwzgnjgcGgx2gvPQz6MQ1B2QLcqvSa8faLA==","signatures":[{"sig":"MEUCIQDD1RGAkne+hzeS0KZvkh6/7LjJvvROE1mzO8rGfQyDQgIgetqCck5/cS9uLin+x3dDfQXhnuNnHzAtb1msLe8g5S8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIG1by/tlSPKofR79vEFE8eySjbsOe65g/NqZTw40CGSTAiEAqcppnp8jMtHhdeGtBipknCetdJ5o9tMmy7GAnEwc0aY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@plugdash%2ffromsubstack@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":66850},"main":"./dist/index.mjs","type":"module","_from":"file:plugdash-fromsubstack-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:ff9c926e-e108-4835-9f7f-bba4bbb6baf5"}},"_resolved":"/tmp/1e05ef9a2d7e9a8231d66082c01d1707/plugdash-fromsubstack-0.1.2.tgz","_integrity":"sha512-gUXGFzR98Adb/6TJoD+DQQS4uWx2P4clReKzEYf/dq/eXnK3+99OwzgnjgcGgx2gvPQz6MQ1B2QLcqvSa8faLA==","repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/fromsubstack"},"_npmVersion":"11.5.1","description":"Import a Substack export into EmDash - posts, metadata, and images","directories":{},"_nodeVersion":"22.23.2","dependencies":{"fflate":"^0.8.2","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/fromsubstack_0.1.2_1790409483465_0.4999558822739181","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"_id":"@plugdash/fromsubstack@0.2.0","bugs":{"url":"https://github.com/plugdash/plugdash/issues"},"dist":{"shasum":"a2956005262ae4729757218bb63201c735157da7","tarball":"https://registry.npmjs.org/@plugdash/fromsubstack/-/fromsubstack-0.2.0.tgz","fileCount":9,"integrity":"sha512-eqABHbRgY5Smux6IhQFHaRyRchX+MMrommOO6Z3XL+Wh/eB6ntlRa9aTNgBfdyCAa0rOcmSS7jGk0GkJpeEMIA==","signatures":[{"sig":"MEUCIDNaI/pPWP8m9aifnvNdnJELNcES46VOXdPQ/HBKqHEyAiEA9/Fzq22Bst5XgfgMUst/aIUe4tMmuc2617/fnf+11LI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCHBdvXuGZBXcVWL0wak6IrOf0tu5ndDHudpVAu0VfVuAIgTXyl7GvIk0lspQDwoLfbv5yMouJxxYkKf6PrN5td4KM="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@plugdash%2ffromsubstack@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":75054},"main":"./dist/index.mjs","name":"@plugdash/fromsubstack","type":"module","_from":"file:plugdash-fromsubstack-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":"ff9c926e-e108-4835-9f7f-bba4bbb6baf5"}},"homepage":"https://github.com/plugdash/plugdash#readme","keywords":["emdash","emdash-plugin","import","migration","substack"],"_resolved":"/tmp/a590bc021bdfdae09b2d7316878e71e6/plugdash-fromsubstack-0.2.0.tgz","_integrity":"sha512-eqABHbRgY5Smux6IhQFHaRyRchX+MMrommOO6Z3XL+Wh/eB6ntlRa9aTNgBfdyCAa0rOcmSS7jGk0GkJpeEMIA==","repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/fromsubstack"},"_npmVersion":"11.5.1","description":"Import a Substack export into EmDash - posts, metadata, and images","directories":{},"maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"_nodeVersion":"22.23.3","dependencies":{"fflate":"^0.8.2","linkedom":"^0.18.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","@types/node":"^22.20.4","@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/fromsubstack_0.2.0_1790936766289_0.3376153684230656"}}},"time":{"created":"2026-09-26T05:16:08.255Z","modified":"2026-10-02T10:26:06.726Z","0.1.0":"2026-09-26T05:16:08.597Z","0.1.1":"2026-09-26T06:31:06.677Z","0.1.2":"2026-09-26T07:58:03.543Z","0.2.0":"2026-10-02T10:26:06.370Z"},"bugs":{"url":"https://github.com/plugdash/plugdash/issues"},"license":"MIT","homepage":"https://github.com/plugdash/plugdash#readme","keywords":["emdash","emdash-plugin","import","migration","substack"],"repository":{"url":"git+https://github.com/plugdash/plugdash.git","type":"git","directory":"packages/fromsubstack"},"description":"Import a Substack export into EmDash - posts, metadata, and images","maintainers":[{"name":"abhinav061","email":"abhinav061@gmail.com"}],"readme":"# @plugdash/fromsubstack\n\nMigrate from Substack to EmDash in minutes. Registers Substack as an import\nsource in EmDash's admin importer: upload the export ZIP you get from\nSubstack's Settings > Exports, and this plugin reads `posts.csv` plus each\npost's HTML, converts bodies to Portable Text, and reports images so EmDash\ncan bring them in too.\n\n## Install\n\n```bash\npnpm add @plugdash/fromsubstack\n```\n\n## Register\n\n```js\n// astro.config.mjs\nimport { defineConfig } from \"astro/config\";\nimport emdash from \"emdash/astro\";\nimport { fromsubstackPlugin } from \"@plugdash/fromsubstack\";\n\nexport default defineConfig({\n\tintegrations: [\n\t\temdash({\n\t\t\tplugins: [fromsubstackPlugin()],\n\t\t}),\n\t],\n});\n```\n\nThe plugin registers a Substack import source (`createSubstackSource()`).\nEmDash 0.41 and 1.0 have no import screen for sources other than WordPress,\nso drive the source from your own script until the admin UI supports it.\nRemove the plugin after the import.\n\n## Configuration\n\nPass options to `fromsubstackPlugin()`:\n\n```js\nfromsubstackPlugin({\n\ttargetCollection: \"newsletter\",\n\tstatus: \"published\",\n\timportImages: true,\n\tpreserveSlugs: true,\n\tpaidPostsAs: \"draft\",\n});\n```\n\n| Option           | Type                             | Default   | Description                                                                                       |\n| ---------------- | -------------------------------- | --------- | ------------------------------------------------------------------------------------------------- |\n| targetCollection | `string`                         | `\"posts\"` | Collection posts import into                                                                      |\n| status           | `\"draft\" \\| \"published\"`         | `\"draft\"` | Status for posts Substack had marked published                                                    |\n| importImages     | `boolean`                        | `true`    | Report body images so EmDash imports them                                                         |\n| preserveSlugs    | `boolean`                        | `true`    | Keep the slug from the Substack post URL                                                          |\n| paidPostsAs      | `\"draft\" \\| \"publish\" \\| \"skip\"` | `\"draft\"` | What to do with paid posts (`only_paid`, `founding`). Applied even when `status` is `\"published\"` |\n\nWarnings (skipped rows, empty bodies) are returned as `warnings` on the\n`analyze()` result and logged with `console.warn` during `fetchContent()`.\n\n`status` defaults to draft on purpose - review imported posts before they go\nlive. A post that was still a draft on Substack always imports as a draft,\nno matter what `status` is set to.\n\n## What gets imported\n\nFrom each row in `posts.csv` with a matching HTML file:\n\n- Title, subtitle (as excerpt), publish date, and slug (from the post's\n  Substack URL, or re-slugified from the title if `preserveSlugs: false`)\n- The body, converted from HTML to Portable Text - headings, bold/italic,\n  links, images, blockquotes, fenced code with language detection, and lists\n- The first body image as the featured image\n- Substack boilerplate is dropped: the subscribe widget, subscribe buttons,\n  share and comment bars, and footnote anchors (footnote text stays)\n- Paid/subscriber-only status, recorded in metadata (`meta.substackPaid`,\n  `meta.substackAudience`) rather than hidden - EmDash doesn't have a native\n  concept of a Substack paywall, so this is left for you to act on\n\nPodcast episodes and other non-article post types in the export are skipped\nwith a warning - there's no article body to convert. A CSV row with no\nmatching HTML file, or a slug that collides with one already imported, is\nalso skipped with a warning rather than failing the whole run.\n\n## What it does not do\n\n- Does not create content on its own - it's a source for EmDash's importer,\n  which does the actual writing\n- Does not guarantee pixel-perfect HTML - unknown tags are unwrapped and\n  their text kept, not preserved as-is\n- Does not resolve Substack's paywall into an EmDash paywall - see\n  [@plugdash/paygate](../paygate) if you need one\n- Does not deduplicate against posts already in EmDash from a previous,\n  different import path - only duplicates within the same export are caught\n","readmeFilename":"README.md"}