An open API service indexing awesome lists of open source software.

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

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.