fff-flavored-frontmatter
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

FFF Flavored Frontmatter

npm minified size downloads deno.land

🌟 Type definition of the FFF Flavored Frontmatter.

Installation

pls confirm the version you need before installing, or always keep the latest version.

pnpm add fff-flavored-frontmatter # pnpm
# yarn add fff-flavored-frontmatter # yarn
# npm i fff-flavored-frontmatter # npm

Usage

Types
// Node
import type { FFFFlavoredFrontmatter } from 'fff-flavored-frontmatter'
// import type { FFFBase, FFFExtra } from 'fff-flavored-frontmatter'
// import type { FFFImage, FFFAudio, FFFVideo, FFFAuthor } from 'fff-flavored-frontmatter'

// Deno
// import type { FFFFlavoredFrontmatter } from 'https://deno.land/x/fff/mod.ts'
Utils
import { type FFFTransformPreset, transform } from 'fff-flavored-frontmatter'

const preset: FFFTransformPreset = {
  created: 'date',
  flags: ({ draft }) => (draft ? ['draft'] : []),
}

const fm = transform({
  date: '2023-02-23',
  draft: true,
}, [preset])

// {
//   date: '2023-02-23',
//   created: '2023-02-23',
//   draft: true,
//   flags: ['draft']
// }
console.log(fm)

Go to References to see the list of utilities.

Package Sidebar

Install

npm i fff-flavored-frontmatter

Homepage

fff.js.org

Weekly Downloads

68

Version

1.2.1

License

WTFPL

Unpacked Size

40.6 kB

Total Files

6

Last publish

Collaborators

  • kwaa