Install command plugin

July 5, 2026 ยท View on GitHub

๐Ÿ“ฆ This package has moved. It now lives in the markdown-magic-plugins monorepo at packages/last-modified. This repository is archived; issues and contributions go to the monorepo.

Install command plugin

Add install command to markdown files via markdown-magic

Install

npm i markdown-magic markdown-magic-last-modified --save-dev

Adding the plugin

See example.js for usage.

import path from 'path';
import { markdownMagic } from 'markdown-magic';
import LASTMODIFIED from './index.js';

const config = {
  matchWord: 'AUTO-GENERATED-CONTENT',
  transforms: {
    LASTMODIFIED,
  },
};

const markdownPath = path.join(import.meta.dirname, 'README.md');
await markdownMagic(markdownPath, config);

Usage in markdown

README.md last modified Sat Mar 26 15:49:09 2022 +0100

Options

  • file (current file by default) - file to get last modified date from (relative to the Markdown file)