Update Node Usage in README (#5675)

This commit is contained in:
garyilayev 2021-05-13 14:37:46 +03:00 committed by GitHub
parent d0331b40ea
commit 802c1d8268
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,26 +56,6 @@ simpleIcons.get('[ICON SLUG]');
// For example:
const icon = simpleIcons.get('simpleicons');
console.log(icon);
/*
{
title: 'Simple Icons',
slug: 'simpleicons',
hex: '111111',
source: 'https://simpleicons.org/',
svg: '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">...</svg>',
path: 'M12 12v-1.5c-2.484 ...',
guidelines: 'https://simpleicons.org/styleguide',
license: {
type: '...',
url: 'https://example.com/'
}
}
NOTE: the `guidelines` entry will be `undefined` if we do not yet have guidelines data for the icon.
NOTE: the `license` entry will be `undefined` if we do not yet have license data for the icon.
*/
```
Alternatively you can import the needed icons individually, where `[ICON SLUG]` is replaced by a [slug].
@ -87,6 +67,11 @@ require('simple-icons/icons/[ICON SLUG]');
// For example:
const icon = require('simple-icons/icons/simpleicons');
```
Either method will return an icon object:
```javascript
console.log(icon);
@ -105,8 +90,8 @@ console.log(icon);
}
}
NOTE: the `guidelines` entry will be `undefined` if we do not yet have guidelines data for the icon.
NOTE: the license may be `undefined` if there is no license data for the icon.
NOTE: the `guidelines` entry will be `undefined` if we do not yet have guidelines for the icon.
NOTE: the `license` entry will be `undefined` if we do not yet have license data for the icon.
*/
```