Skip to content

Instantly share code, notes, and snippets.

// create-national-park-md.js
// Usage: node create-national-park-md.js [outputDir]
// Example: node create-national-park-md.js ./parks
// If no outputDir is provided, it writes to ./national-parks
import fs from 'node:fs/promises'
import path from 'node:path'
// --- Configuration ---
const OUTPUT_DIR = process.argv[2] || path.resolve('./national-parks')
@scottfwalter
scottfwalter / markdown_cover_extractor.js
Created June 29, 2025 15:40
Create cover coverFilename property based on first image in document
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
/**
* Extracts the first image reference in ![[filename]] format from markdown content
* @param {string} content - The markdown content
* @returns {string|null} - The extracted filename or null if not found
*/