JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2093784
  • Score
    100M100P100Q199591F
  • License MIT

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

Package Exports

  • @changesets/parse

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@changesets/parse) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@changesets/parse

View changelog

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

import parse from "@changesets/parse";

const changeset = `---
"@changesets/something": minor
"@changesets/something-else": patch
---

A description of a minor change`;

const parsedChangeset = parse(changeset);

For example, it can convert:

---
"@changesets/something": minor
"@changesets/something-else": patch
---

A description of a minor change

to

{
  "summary": "A description of a minor change",
  "releases": [
    { "name": "@changesets/something", "type": "minor" },
    { "name": "@changesets/something-else", "type": "patch" }
  ]
}

Note that this is not quite a complete Changeset for most tools as it lacks an id.

For written changesets, the id is normally given as the file name, which parse is not aware of.