https://github.com/shinnn/is-changelog-path
Check if a given value is a <string> that looks like a CHANGELOG file path
https://github.com/shinnn/is-changelog-path
changelog history javascript nodejs path release-notes
Last synced: 4 months ago
JSON representation
Check if a given value is a <string> that looks like a CHANGELOG file path
- Host: GitHub
- URL: https://github.com/shinnn/is-changelog-path
- Owner: shinnn
- License: isc
- Created: 2015-11-18T11:48:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-04-19T20:41:54.000Z (about 6 years ago)
- Last Synced: 2025-03-05T02:09:17.673Z (4 months ago)
- Topics: changelog, history, javascript, nodejs, path, release-notes
- Language: JavaScript
- Homepage: https://npm.runkit.com/is-changelog-path
- Size: 56.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-changelog-path
[](https://www.npmjs.com/package/is-changelog-path)
[](https://travis-ci.com/shinnn/is-changelog-path)
[](https://codecov.io/gh/shinnn/is-changelog-path)Check if a given value is a `string` that looks like a CHANGELOG file path
```javascript
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](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).
```
npm install is-changelog-path
```## API
```javascript
const isChangelogPath = require('is-changelog-path');
```### isChangelogPath(*filePath*)
*filePath*: `any`
Return: `boolean`It returns `true` if it takes a `string` whose [last path portion](https://nodejs.org/api/path.html#path_path_basename_path_ext) matches [changelog-filename-regex](https://github.com/shinnn/changelog-filename-regex), otherwise `false`.
```javascript
const isChangelogPath = require('is-changelog-path');isChangelogPath('release-note.md'); //=> true
isChangelogPath('/Users/shinnn/release-note.md'); //=> trueisChangelogPath('release/-note.md'); //=> false
isChangelogPath('release-note.md.js'); //=> false
isChangelogPath('release-note.md/'); //=> false
isChangelogPath('release-note.md\\'); //=> falseisChangelogPath(new Set(['not', 'a', 'string'])); //=> false
```## License
[ISC License](./LICENSE) © 2018 - 2019 Shinnosuke Watanabe