Have ideas to improve npm?Join in the discussion! »

    is-changelog-path

    2.0.0 • Public • Published

    is-changelog-path

    npm version Build Status Build status Coverage Status

    Check if a given value is a string that looks like a CHANGELOG file path

    const isChangelogPath = require('is-changelog-path');
     
    // Relative paths
     
    isChangelogPath('CHANGELOG.txt'); //=> true
    isChangelogPath('lib/index.js'); //=> false
     
    // Absolute paths
     
    isChangelogPath('/Users/shinnn/docs/history.md'); //=> true
    isChangelogPath('/Applications/Google Chrome.app'); //=> false

    Installation

    Use npm.

    npm install is-changelog-path
    

    API

    const isChangelogPath = require('is-changelog-path');

    isChangelogPath(filePath)

    filePath: any
    Return: boolean

    It returns true if it takes a string whose last path portion matches changelog-filename-regex, otherwise false.

    const isChangelogPath = require('is-changelog-path');
     
    isChangelogPath('release-note.md'); //=> true
    isChangelogPath('/Users/shinnn/release-note.md'); //=> true
     
    isChangelogPath('release/-note.md'); //=> false
    isChangelogPath('release-note.md.js'); //=> false
    isChangelogPath('release-note.md/'); //=> false
    isChangelogPath('release-note.md\\'); //=> false
     
    isChangelogPath(new Set(['not', 'a', 'string'])); //=> false

    License

    ISC License © 2018 Shinnosuke Watanabe

    Install

    npm i is-changelog-path

    DownloadsWeekly Downloads

    1

    Version

    2.0.0

    License

    ISC

    Unpacked Size

    4.08 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar