Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@liip/npm-icons

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liip/npm-icons

Import svg icons using cli

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Official Documentation

To get started quickly you can add liip-npm-icons dependency to your project:

npm install @liip/npm-icons

Then create a config file .npm-iconsrc.json and where you want to download your icons

{
  "iconsPath": "./src/assets/icons",
}

Extended configuration

You would need to add the following variable to your .npm-iconsrc.json

{
  "iconsPath": "./src/assets/icons",
  "iconsSvgBaseUrl": "https://icons.liip.ch/icons",
  "iconsJsonUrl": "https://icons.liip.ch/icons.json",
  "iconsTypes": ["regular", "light"]
}

Basic command use

npx icons add <icon-name>

Vue 3 integration

Requirements:

  • Vue 3
  • Vite
  1. First we need to install vite-svg-loader to be able to use svg files as vue components:
npm install vite-svg-loader --save-dev
  1. Add svgLoader to vite.config.js
import svgLoader from 'vite-svg-loader'

export default defineConfig({
  plugins: [vue(), svgLoader()]
})
  1. Add the vue icon component BaseIcon
import { createApp } from 'vue'
import App from './App.vue'
import BaseIcon from '@liip/npm-icons'

createApp(App)
  .use(BaseIcon)
  .mount('#app')
  1. Use the baseIcon component passing the icon name
<template>
  <BaseIcon name="house" />
</template>
  1. (Optional) In case your icons are not located on- /src/assets/icons
<template>
  <BaseIcon name="house" iconsPath="/different/icons/path" />
</template>

Contribute

To contribute first clone the project:

git clone git@github.com:liip/npm-icons.git

Release

The tool release-it is used to make a release so it is as simple as running the following command:

npm run release 

Update documentation

Our documentation is made with nuxt-content and the docs theme If you want to make any changes you need execute the following commands:

cd docs
npm install
npm run dev
Deployment

The deployment is made with github pages using static files thanks to nuxt generate. If you want to deploy some changes just run npm run release and then answer yes to the question Do you want to build the docs? then release-it will run nuxt generate and commit the changes into the tag commit.

Keywords

FAQs

Package last updated on 23 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc