sub2mark-lib
v1.0.0
Published
Convert Substack posts to Markdown (library + CLI).
Readme
sub2mark-lib
Converts Substack posts to Markdown.
Currently supports free posts only.
Install
npm install sub2mark-libLibrary Usage
import { convertSubstackToMarkdown, convertSubstackToZip } from 'sub2mark-lib';
// Note: The link used here does not exist. Use a real one.
const result = await convertSubstackToMarkdown('https://example.substack.com/p/my-post', {
outputDir: './output',
mdFilename: 'post.md'
});
console.log(result.postDir);
const zipResult = await convertSubstackToZip('https://example.substack.com/p/my-post', {
outputDir: './output',
zipName: 'my-post.zip'
});
console.log(zipResult.zipPath);CLI Usage
sub2mark https://example.substack.com/p/my-post --out ./output --zipNotes
- Requires Node.js 18+ (for
fetch). - The converter downloads images and stores them under
./output/<slug>/images.
