@liip/npm-icons
Advanced tools
Comparing version 0.2.3 to 0.2.4
import path from 'path'; | ||
import { cosmiconfigSync } from 'cosmiconfig'; | ||
import dotenv from 'dotenv'; | ||
dotenv.config(); | ||
let iconsPath = path.resolve('./src/assets/icons'); | ||
@@ -8,4 +11,4 @@ let iconsSvgBaseUrl = 'https://icons.liip.ch/icons'; | ||
let iconsTypes = ['regular', 'light']; | ||
let username = null; | ||
let password = null; | ||
let username = process.env.ICONS_AUTH_USERNAME; | ||
let password = process.env.ICONS_AUTH_PASSWORD; | ||
@@ -31,3 +34,3 @@ const explorer = cosmiconfigSync('npm-icons'); | ||
} | ||
if (authorizationConfig) { | ||
if (authorizationConfig && !username && !password) { | ||
username = authorizationConfig.config.authorization.username; | ||
@@ -34,0 +37,0 @@ password = authorizationConfig.config.authorization.password; |
{ | ||
"name": "@liip/npm-icons", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "Import svg icons using cli", | ||
@@ -54,2 +54,3 @@ "keywords": [ | ||
"cosmiconfig": "^7.0.1", | ||
"dotenv": "^16.0.1", | ||
"prompts": "^2.4.2", | ||
@@ -56,0 +57,0 @@ "slugify": "^1.6.5" |
@@ -32,3 +32,9 @@ ## [Official Documentation](https://liip.github.io/npm-icons/website) | ||
``` | ||
In case you want to add the username and password as environment variable you can use: | ||
```.dotenv | ||
ICONS_AUTH_USERNAME="yourUsername" | ||
ICONS_AUTH_PASSWORD="yourPassword" | ||
``` | ||
### Basic command use | ||
@@ -35,0 +41,0 @@ ```bash |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
15789
386
117
7
7
+ Addeddotenv@^16.0.1
+ Addeddotenv@16.4.7(transitive)