Document enumerability of the simple-icons object (#4814)

This commit is contained in:
Eric Cornelissen 2021-01-19 18:50:03 +01:00 committed by GitHub
parent dce8c26312
commit 8cbaa6b22a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,6 +84,18 @@ console.log(icon);
*/
```
Lastly, the `simpleIcons` object is also enumerable.
This is useful if you want to do a computation on every icon:
```javascript
const simpleIcons = require('simple-icons');
for (const title in simpleIcons) {
const icon = simpleIcons.get(title);
// do stuff
}
```
#### TypeScript Usage
There are also TypeScript type definitions for the Node package. To use them, simply run: