Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 27 days 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 (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-04-19T20:41:54.000Z (over 5 years ago)
- Last Synced: 2024-09-17T01:21:16.766Z (about 2 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
[![npm version](https://img.shields.io/npm/v/is-changelog-path.svg)](https://www.npmjs.com/package/is-changelog-path)
[![Build Status](https://travis-ci.com/shinnn/is-changelog-path.svg?branch=master)](https://travis-ci.com/shinnn/is-changelog-path)
[![codecov](https://codecov.io/gh/shinnn/is-changelog-path/branch/master/graph/badge.svg)](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