npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@balena/compose-parser-v7

v1.0.0

Published

Frozen legacy docker-compose parser extracted from @balena/compose, serving the builder /v3 endpoint

Readme

@balena/compose-parser-v7

The original balena compose file parser, based on JSON schema, extracted from @balena/compose so that it can be maintained without being changed.

Releases are built with either this parser or @balena/compose-parser (compose-go), and users move between them on their own schedule by upgrading the CLI. That only works if this parser keeps behaving exactly as it does today, which is what the package exists to guarantee.

The point is that behavior does not change

This package gets Renovate coverage, because we want CVE patches. That is also how behavior drifts, and a YAML loader can change how a compose file parses without this parser changing at all.

So test/snapshots/ covers the whole pipeline the builder runs, taking YAML source through js-yaml, then normalize and parse. A dependency bump that changes any of it fails CI instead of shipping.

A diff there is a behaviour change for everyone still on this parser, not a snapshot to refresh. To review one:

UPDATE_SNAPSHOTS=1 npm test
git diff test/snapshots

js-yaml is pinned to v4 in renovate.json for the same reason, which means forgoing a v5 CVE fix. Revisit that alongside the decision on how long this parser stays supported, not on its own.

Usage

import { normalize, parse } from '@balena/compose-parser-v7';
import { toModernImageDescriptors } from '@balena/compose-parser-v7/adapter';

const composition = normalize(JsYaml.load(source));
const descriptors = parse(composition);

// Adapt to the compose-go shape, so either parser feeds one build pipeline
const modern = toModernImageDescriptors(descriptors);

toModernImageDescriptors maps this parser's descriptors onto the @balena/compose-parser types. Only descriptors, since the two compositions differ in value and not only in shape, which lib/adapter.ts explains.

It sits on its own subpath because it is the only part that names @balena/compose-parser, which is an optional peer dependency. That package ships a Go binary, so anyone who only needs the legacy parser should not have to install it, and importing the root needs nothing extra.

Maintaining

  • Treat lib/ as frozen. It was extracted verbatim from balena-compose@dae995f^:lib/parse/ and should stay diffable against it.
  • Fix bugs here only when this parser is demonstrably wrong, and say so in the changelog.
  • New compose features belong in @balena/compose-parser, not here.