Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/wildcard-match
A function for matching strings using * wildcard patterns.
https://github.com/afeiship/wildcard-match
fast glob match star wildcard
Last synced: 22 days ago
JSON representation
A function for matching strings using * wildcard patterns.
- Host: GitHub
- URL: https://github.com/afeiship/wildcard-match
- Owner: afeiship
- License: mit
- Created: 2016-10-26T16:00:35.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-09-08T09:21:30.000Z (4 months ago)
- Last Synced: 2024-10-28T07:30:10.727Z (2 months ago)
- Topics: fast, glob, match, star, wildcard
- Language: TypeScript
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# wildcard-match
> A function for matching strings using * wildcard patterns.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```shell
npm install @jswork/wildcard-match
```## usage
```js
import wildcardMatch from '@jswork/wildcard-match';// 测试案例
console.log(wildcardMatch("filename.txt", "*name")); // false
console.log(wildcardMatch("filename.txt", "name*")); // false
console.log(wildcardMatch("filename.txt", "*name*")); // true
console.log(wildcardMatch("abcfilenameabc", "*xx*name*xx*")); // false
console.log(wildcardMatch("xxabcnamexx", "*xx*name*xx*")); // true
```## license
Code released under [the MIT license](https://github.com/afeiship/wildcard-match/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/wildcard-match
[version-url]: https://npmjs.org/package/@jswork/wildcard-match[license-image]: https://img.shields.io/npm/l/@jswork/wildcard-match
[license-url]: https://github.com/afeiship/wildcard-match/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/wildcard-match
[size-url]: https://github.com/afeiship/wildcard-match/blob/master/dist/index.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/wildcard-match
[download-url]: https://www.npmjs.com/package/@jswork/wildcard-match