@geut/chan-core

    3.2.6 • Public • Published

    chan-core

    API to work with chast

    Note

    Since v3.0 this module is ESM only.

    Install

    npm install @geut/chan-core

    Use

    import toVFile from 'to-vfile'
    import { initialize, addChanges, addRelease, getMarkdownRelease } from '@geut/chan-core'
    
    const file = toVFile.readSync('CHANGELOG.md')
    
    await initialize(file)
    
    await addChanges(file, {
      changes: [
        { action: 'Security', value: 'alguna cosa' },
        {
          action: 'Changed',
          value: 'vaaamos',
          group: 'package2'
        },
        {
          version: '0.0.1',
          action: 'Fixed',
          value: 'fixed algo viejo',
          group: 'package1'
        }
      ]
    })
    
    await addRelease(file,   {
      version: '0.0.2',
      gitTemplate: 'https://github.com/geut/chan/compare/[prev]...[next]',
      gitBranch: 'HEAD',
      mergePrerelease: true,
      releasePrefix: 'v'
    })
    
    await getMarkdownRelease(file, { version: '0.0.1' })

    API

    initialize (from, { overwrite })

    from {vfile}

    overwrite {Boolean}

    true to overwrite if file already exists. Default to false

    addChanges (from, { changes })

    from {vfile}

    changes {Array}

    chast representation for a set of changes.

    addRelease (from, { version, date, yanked, gitTemplate, gitBranch, allowYanked, allowPrerelease, mergePrerelease, releasePrefix })

    from {vfile}

    getMarkdownRelease (from, { version })

    from {vfile}

    version {String}

    The version to extract from file.

    Keywords

    none

    Install

    npm i @geut/chan-core

    DownloadsWeekly Downloads

    116

    Version

    3.2.6

    License

    ISC

    Unpacked Size

    30.8 kB

    Total Files

    18

    Last publish

    Collaborators

    • geutuser
    • elmasse
    • the-real-dk
    • tinchoz49
    • estebanprimost