1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-12-16 01:10:30 +02:00

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.
This commit is contained in:
Eric Cornelissen 2021-02-08 16:03:12 +01:00 committed by GitHub
parent 22c577c177
commit ce27500858
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);