From 8cbaa6b22ab998d563a553be6c24a62f5ce4d61b Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Tue, 19 Jan 2021 18:50:03 +0100 Subject: [PATCH] Document enumerability of the simple-icons object (#4814) --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 2d4ff0a29..36bbf14e2 100644 --- a/README.md +++ b/README.md @@ -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: