@changesets/parse

Parse a changeset file's contents into a usable json object

  • Types
  • ESM
License
MIT
Install Size
5.9 kB(700.2 kB)
Vulns
0
Published

Get started

$npm install @changesets/parse

Weekly DownloadsAcross all versions

Node.js
^22.11 || ^24 || >=26
1.0.0
latest

Readme

@changesets/parse

Open on npmx.dev View changelog

Parse a changeset from its written format to a data object.

Usage

import { parseChangesetFile } from "@changesets/parse";

const changeset = `---
"pkg-a": minor
"pkg-b": patch
---

A summary of the change`;

const parsedChangeset = parseChangesetFile(changeset);
// {
//   "summary": "A summary of the change",
//   "releases": [
//     { "name": "pkg-a", "type": "minor" },
//     { "name": "pkg-b", "type": "patch" }
//   ]
// }

Note that this does not include the changeset id, but it is normally given as the file name, which parse is not aware of.