@alvincrespo/hashnode-content-converter - v0.2.2
    Preparing search index...

    Class FileWriter

    Service for writing blog posts to the filesystem Handles directory creation, file writing, path validation, and error handling

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Check if a post already exists in the output directory

      Parameters

      • outputDir: string

        Base output directory

      • slug: string

        Post slug to check

      Returns boolean

      True if post directory exists, false otherwise

    • Write a blog post with frontmatter and content to the filesystem

      Parameters

      • outputDir: string

        Base output directory (e.g., './blog')

      • slug: string

        Post slug (used as subdirectory name)

      • frontmatter: string

        YAML frontmatter string (includes --- markers)

      • content: string

        Markdown content body

      Returns Promise<string>

      Absolute path to the written file

      FileWriteError if write fails or file exists (when overwrite=false)