npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tryghost/mg-substack

v0.9.1

Published

Converts a Substack `zip` export and generates a `zip` file you can import into a Ghost installation.

Readme

Migrate Substack zip Export

Converts a Substack zip export and generates a zip file you can import into a Ghost installation.

Install

To install the CLI, which is required for the Usage commands below:

npm install --global @tryghost/migrate

To use this package in your own project:

npm install @tryghost/mg-substack --save

or

yarn add @tryghost/mg-substack

Usage

To run basic Substack migration, the required command is this:

migrate substack --pathToZip /path/to/my-export.zip --url https://example.com

A more complex command for a Substack migration looks like this:

migrate substack --pathToZip /path/to/my-export.zip --url https://example.com --email '[email protected]' --drafts false
migrate substack --pathToZip /path/to/my-export.zip --url https://example.com --posts false --pages false --podcasts false --threads true

It's possible to pass more options, in order to achieve a better migration file for Ghost:

  • --pathToZip (required)
    • Path to a zip file
    • string - default: null
  • --url (required)
    • Site URL
    • string - default: null
  • -V --verbose
    • Show verbose output
    • bool - default: false
  • --zip
    • Create a zip file
    • bool - default: true
  • -s --scrape
    • Configure scraping tasks
    • string - default: all
    • Choices: all, web, assets, none
      • all: Scrape web metadata and download assets
      • web: Only scrape metadata from web pages
      • assets: Only download assets (images, media, files)
      • none: Skip all scraping tasks
  • -e --email
    • Provide an email domain for users e.g. [email protected] (Is ignored if --useMetaAuthor is provided)
    • bool/string - default: false
  • --addTag
    • string - default: null
    • Provide a tag name which should be added to every post in this migration (Wrap in single quotes if tag name has spaces 'Like This')
  • --addPlatformTag
    • Add #substack tag to migrated content
    • bool - default: true
  • --addTypeTag
    • Add #substack-{type} tag to migrated content (post, podcast, etc)
    • bool - default: true
  • --addAccessTag
    • Add #substack-{access} tag to migrated content (public, paid, etc)
    • bool - default: true
  • --posts
    • Import posts
    • bool - default: true
  • --drafts
    • Import draft posts
    • bool - default: true
  • --pages
    • Import pages
    • bool - default: true
  • --podcasts
    • Import podcasts
    • bool - default: true
  • --threads
    • Import threads
    • bool - default: false
  • --subscribeLink
    • Provide a path that existing /subscribe anchors will link to e.g. /join-us or #/portal/signup (# characters need to be escaped with a \)
    • string - default: #/portal/signup
  • --noSubscribeButtons
    • Remove subscribe buttons and links from content (no replacement link)
    • bool - default: false
  • --comments
    • Keep comment buttons
    • bool - default: true
  • --commentLink
    • Provide a path that existing /comments anchors will link to e.g. #ghost-comments-root (# characters need to be escaped with a \)
    • string - default: #ghost-comments-root
  • --useMetaImage
    • Use og:image value as the feature image
    • bool - default: true
  • --useFirstImage
    • Use the first image in content as the feature image (useMetaImage takes priority)
    • bool - default: true
  • --useMetaAuthor
    • Use the author field from ld+json (useful for posts with multiple authors)
    • bool - default: true
  • --postsBefore
    • Only migrate posts before and including a given date e.g. 'March 20 2018'
    • string - default: null
  • --postsAfter
    • Only migrate posts after and including a given date e.g. 'August 16 2023'
    • string - default: null
  • --fallBackHTMLCard
    • Fall back to convert to HTMLCard, if standard Mobiledoc convert fails
    • bool - default: true
  • --cache
    • Persist local cache after migration is complete (Only if --zip is true)
    • bool - default: true

Note: You can combine --postsBefore and --postsAfter to migrate posts between 2 dates.

Develop

This is a mono repository, managed with lerna.

Follow the instructions for the top-level repo.

  1. git clone this repo & cd into it as usual
  2. Run yarn to install top-level dependencies.

Run

To run a local development copy, cd into this directory, and use yarn dev instead of migrate like so:

yarn dev substack <pathToZip>

Test

  • yarn lint run just eslint
  • yarn test run lint and tests

Copyright & License

Copyright (c) 2013-2026 Ghost Foundation - Released under the MIT license.