mirror of
https://github.com/simple-icons/simple-icons.git
synced 2025-01-05 01:20:39 +02:00
Update Node Usage in README (#5675)
This commit is contained in:
parent
d0331b40ea
commit
802c1d8268
29
README.md
29
README.md
@ -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.
|
||||
*/
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user