Home/Tools/@tpmjs/createblogpost

createBlogPostTool

@tpmjs/createblogpost

Creates a structured blog post with frontmatter, metadata, slug, word count, and reading time. Outputs in Markdown or MDX format.

Official
text-analysis
v0.3.0
MIT

Interactive Playground

Test @tpmjs/createblogpost (createBlogPostTool) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @tpmjs/createblogpost
pnpm add @tpmjs/createblogpost
yarn add @tpmjs/createblogpost
bun add @tpmjs/createblogpost
deno add npm:@tpmjs/createblogpost

2. Import the tool

import { createBlogPostTool } from '@tpmjs/createblogpost';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { createBlogPostTool } from '@tpmjs/createblogpost';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { createBlogPostTool },
  prompt: 'Your prompt here...',
});

console.log(result.text);

AI Agent Integration

How AI agents can use this tool

Use Case

Use this tool when users need to generate blog posts, articles, or structured content with proper frontmatter and metadata. Ideal for content management systems, static site generators, and documentation sites.

Limitations

Does not include AI content generation - you must provide the content. Only formats and structures existing content.

Examples

  • Create a blog post about TypeScript best practices
  • Generate a tutorial post with code examples
  • Format an article with SEO metadata

Parameters

Available configuration options

Auto-extracted
title
Required
Type: string

The title of the blog post

author
Required
Type: string

The author of the blog post

content
Required
Type: string

The main content of the blog post

tags
Optional
Type: array

Array of tags for categorization

format
Optional
Type: string

Output format for the blog post (default: markdown)

excerpt
Optional
Type: string

Short excerpt or summary of the post

Schema extracted: 1/15/2026, 3:44:46 AM

README

@tpmjs/createblogpost

A tool for creating structured blog posts with frontmatter and metadata. Part of the TPMJS registry.

Installation

npm install @tpmjs/createblogpost
# or
pnpm add @tpmjs/createblogpost
# or
yarn add @tpmjs/createblogpost

Usage

import { createBlogPost } from '@tpmjs/createblogpost';

const post = await createBlogPost({
  title: 'Getting Started with TypeScript',
  author: 'John Doe',
  content: 'TypeScript is a typed superset of JavaScript that compiles to plain JavaScript...',
  tags: ['typescript', 'javascript', 'programming'],
  excerpt: 'Learn the basics of TypeScript in this comprehensive guide',
  format: 'markdown',
});

console.log(post.formattedOutput);

API

createBlogPost(options: BlogPostOptions): Promise<BlogPost>

Creates a structured blog post with frontmatter and metadata.

Options

ParameterTypeRequiredDefaultDescription
titlestringYes-The title of the blog post
authorstringYes-The author of the blog post
contentstringYes-The main content of the blog post
tagsstring[]No[]Array of tags for categorization
format'markdown' | 'mdx'No'markdown'Output format for the blog post
excerptstringNo-Short excerpt or summary of the post
publishDateDateNonew Date()Publication date

Returns

Returns a BlogPost object with the following structure:

{
  frontmatter: {
    title: string;
    author: string;
    date: string;        // ISO date format (YYYY-MM-DD)
    tags: string[];
    slug: string;        // Auto-generated from title
    wordCount: number;   // Calculated from content
    readingTime: number; // Estimated minutes to read
    excerpt?: string;
  };
  content: string;
  formattedOutput: string; // Complete post with frontmatter
}

Example Output

---
title: "Getting Started with TypeScript"
author: John Doe
date: 2025-11-28
slug: getting-started-with-typescript
tags: ["typescript", "javascript", "programming"]
excerpt: "Learn the basics of TypeScript in this comprehensive guide"
wordCount: 250
readingTime: 2
---

TypeScript is a typed superset of JavaScript that compiles to plain JavaScript...

Features

  • Automatic slug generation from title
  • Word count calculation
  • Reading time estimation (200 words/min)
  • Support for both Markdown and MDX formats
  • Customizable frontmatter
  • SEO-friendly metadata

Use Cases

  • Static site generators (Next.js, Gatsby, Astro)
  • Content management systems
  • Blog platforms
  • Documentation sites
  • Automated content generation

License

MIT

Statistics

Downloads/month

22

GitHub Stars

0

Quality Score

79%

Bundle Size

NPM Keywords

tpmjs-tool
blog
content
ai
writing

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai