@limaformat/lima
v0.5.0
Published
Lima frontmatter parser — LIMA Is Metadata Annotation
Maintainers
Readme
@limaformat/lima
LIMA Is Metadata Annotation — a small, predictable frontmatter format. A deliberate, focused subset of YAML: the part frontmatter actually needs, with well-defined types, no surprises, and zero runtime dependencies.
npm install @limaformat/lima
# or
bun add @limaformat/limaimport { parse } from '@limaformat/lima'
const result = parse(`
title: Hello World
published: 2024-03-01
draft: false
tags:
- javascript
- webdev
`)
// {
// title: 'Hello World',
// published: 2024-03-01T00:00:00.000Z, // a Date
// draft: false,
// tags: ['javascript', 'webdev']
// }parse accepts the raw content between the frontmatter delimiters
(---) — stripping them is the caller's job.
Three functions are exported:
parseCore(input, options?)— the base format only.parse(input, options?)— the primary References 2.0 parser; adds${key}document references and$(key)external partials.parseReferences(input, options?)— deprecated compatibility alias forparsewith the same References 2.0 semantics.
parse(frontmatter, { strict: true })
parse(frontmatter, { partials: { author: 'Alice' } })
parse(frontmatter, { mode: 'core' }) // same reference-unaware path as parseCoreThe guide covers Core and References 2.0 syntax, resource limits, strict mode, and the public API. The normative rules are defined in the References 2.0 specification.
Why Lima exists, the case against YAML, and security rationale: repository README.
The Lima Core 1.0 and Lima References 2.0 specifications are the source of truth for these public entry points. The frozen References 1.0 implementation remains available internally to run its independent conformance suite.
Migrating existing YAML frontmatter: docs/migrating-from-yaml.md. Static site generator integration status: docs/integrations.md.
License
ISC — see
LICENSE (also
included in this package as LICENSE).
