Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tpkn/find-images
Searching for images by resolution and size for Node.js
https://github.com/tpkn/find-images
Last synced: 6 days ago
JSON representation
Searching for images by resolution and size for Node.js
- Host: GitHub
- URL: https://github.com/tpkn/find-images
- Owner: tpkn
- License: mit
- Created: 2018-04-23T20:43:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-16T13:50:27.000Z (over 5 years ago)
- Last Synced: 2025-01-13T09:42:15.992Z (7 days ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Find Images [![npm Package](https://img.shields.io/npm/v/find-images.svg)](https://www.npmjs.org/package/find-images)
Searching for images by resolution and size for Node.jsIt's synchronous flexible module for relatively small tasks.
## Installation
```bash
npm install find-images
```## API
```javascript
FindImages(input[, resolution, size_limit])
```### input
**Type**: _String_ | _Array_
Could be a path to images folder or an array of images### resolution
**Type**: _String_
**Default**: `100%x100%`
Searching for images with this resolution. To ignore width or height, just set it's value as a percentage: `100%x250`. To skip this option leave it empty `''` or set it to `null`.### size_limit
**Type**: _Number_
Filter results by size (in KB)## Usage
```javascript
const FindImages = require('find-images');let results = FindImages(input, '540x100%', 500);
// => [{ path: '/test/540x180.jpg', resolution: '540x180', size: '70.08' }]
```## Output format
```
[
{
path: '/test/540x180.jpg',
resolution: '540x180',
size: '70.08'
},
]
```## Changelog
#### v2.0.0 (2019-02-16):
- updated for new version of `ReadDirRec`
- removed async method#### v1.0.8 (2018-10-03):
- fixed bug, when size string was extracted with space#### v1.0.5 (2018-05-14):
- fixed crash due to an `unsupported file type` error