https://github.com/clems71/filter-by-string
Filter a collection of objects from a search string
https://github.com/clems71/filter-by-string
filter nodejs npm search
Last synced: about 2 months ago
JSON representation
Filter a collection of objects from a search string
- Host: GitHub
- URL: https://github.com/clems71/filter-by-string
- Owner: clems71
- Created: 2017-02-09T11:15:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-13T12:40:10.000Z (about 9 years ago)
- Last Synced: 2025-10-04T06:44:00.358Z (8 months ago)
- Topics: filter, nodejs, npm, search
- Language: JavaScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# filter-by-string
[](https://github.com/prettier/prettier)
## Simple example
```js
const filterByString = require('filter-by-string')
const collection = [
{ id: 123, title: 'wash dishes', draft: false },
{ id: 124, title: 'wash house', draft: true },
{ id: 125, title: 'clean whiteboard', draft: false }
]
const result = filterByString('draft is false and title is wash*', collection)
// result is [{ id: 123, title: 'wash dishes', draft: false }]
```