auto-front-matter
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

auto-front-matter

auto-front-matter

Automatic Front Matter for Markdown

NPM version NPM Downloads

features

auto-front-matter provides two commands: auto-front-matter watch and auto-front-matter create.

  1. auto-front-matter watch

Automatically insert lastmod and duration when saving the md file.

auto-front-matter watch

  1. auto-front-matter create

auto-front-matter create

Installation

npm install -D auto-front-matter

A frontmatter.json file is required in the project directory. The frontmatter.json file supports the following fields:

  • dirname: Specify the directory to be updated.using glob, default current directory.
  • globOptions: glob's options.
  • insertLastMod: Whether to insert lastmod in front-matter, default true.
  • insertReadTime: Whether to insert duration in front-matter, default true.
  • newFileIsInsertLastMod: Whether to insert lastmod in front-matter for uncommitted file, default false.
  • newFileIsInsertReadTime: Whether to insert duration in front-matter for uncommitted file, default false.
  • wordsPerMinute: words per minute, default 500.
  • template: Creating Markdown file depends on this template, default GET_DEFAULT_FRONT_MATTER.
export const GET_DEFAULT_FRONT_MATTER = () => {
	return {
		data: {
			date: new Date(new Date().toISOString()),
			author: "CondorHero",
			tags: ["hello", "world"],
			categories: "blog",
		},
		content: "\n# Hello World!\n",
	};
};

License

MIT

Package Sidebar

Install

npm i auto-front-matter

Weekly Downloads

1

Version

0.0.4

License

MIT

Unpacked Size

158 kB

Total Files

81

Last publish

Collaborators

  • condorhero