https://github.com/momsfriendlydevco/fa-icons
Module which returns the closest FontAwesome class to a file name
https://github.com/momsfriendlydevco/fa-icons
Last synced: over 1 year ago
JSON representation
Module which returns the closest FontAwesome class to a file name
- Host: GitHub
- URL: https://github.com/momsfriendlydevco/fa-icons
- Owner: MomsFriendlyDevCo
- License: mit
- Created: 2019-06-14T05:28:24.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-12T06:31:20.000Z (about 7 years ago)
- Last Synced: 2025-03-25T12:50:54.679Z (over 1 year ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
@MomsFriendlyDevCo/Icons
========================
Module which returns the closest FontAwesome class to a file name.
```javascript
var faIcons = require('@momsfriendlydevco/fa-icons');
faIcons('something.mp4') //= "fas fa-file-video"
faIcons('something.csv') //= "fas fa-file-csv"
faIcons('something.weird') //= "fas fa-file"
```
API
===
This module exposes a single function which resolves with the best matching class based on an input file path.
faIcons(path)
-------------
Returns the cloest matching icon based on the internal index.
faIcons.index
-------------
Collection of rules to use when matching the path against the icon.