Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@sissijs/smolyaml

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sissijs/smolyaml

SmolYAML implements a small minimalistic subset of the YAML specification.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

SmolYAML

SmolYAML is a minimalistic parser for YAML-like data.

YAML is a complex spec.

An npm install yaml weighs about 100kb of minified JavaScript.

SmolYAML is used in a static site generator that tries tries to be as minimalistic as possible. That static site generator depends on YAML for parsing frontmatter, a block of meta data in template files. But including the full YAML implementation would quite bloat it.

SmolYAML tries to address that by implementing only a small subset of the specification. To be fair, it's an opinionated one that is (opinionatedly) considered good enough to parse frontmatter meta data.

In roughly 2KB of minified JavaScript.

Usage

npm i @sissijs/smolyaml
import { smolYAML } from '@sissijs/smolyaml';

const metadata = `
name: Lea
description: Lea is a Web Developer
age: 42
details:
  frontend: She loves doing Front of the Frontend work
  fullstack: But she really hates being called a fullstack developer
`

console.log(smolYAML(metadata));

Limitations

  • Right now, multi-line string values aren't supported.
  • Only a parser is provided.

FAQs

Package last updated on 03 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts