From ce27500858d38947e09ebf165d2a999320291347 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Mon, 8 Feb 2021 16:03:12 +0100 Subject: [PATCH] Update Node Usage section in README (#4950) Update the examples in the "Node Usage" section of the README to clarify where you need to specify the brand you're interested in. The approach follows the style of the "CDN Usage" section of the README. --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d7eda09..8608e230 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,13 @@ The API can then be used as follows: ```javascript const simpleIcons = require('simple-icons'); -console.log(simpleIcons.get('Simple Icons')); +// Get a specific icon by its name as: +simpleIcons.get('[ICON NAME]'); + +// For example: +const icon = simpleIcons.get('simpleicons'); + +console.log(icon); /* { @@ -68,6 +74,10 @@ Alternatively you can import the needed icons individually. This is useful if you are e.g. compiling your code with [webpack](https://webpack.js.org/) and therefore have to be mindful of your package size: ```javascript +// Import a specific icon by its name as: +require('simple-icons/icons/[ICON NAME]'); + +// For example: const icon = require('simple-icons/icons/simpleicons'); console.log(icon);