npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-octicons

v0.1.9

Published

A GitHub Octicons component for Vue.js

Downloads

41

Readme

vue-octicons

A GitHub Octicons component for Vue.js.

Quick Note: This is my first NPM package, and I'm a PHP developer primarily. I needed this for an application and couldn't get Justineo/vue-octicon to work for me. I used the webpack template for VueJS, and while there are e2e and unit tests, these are currently just the sample tests that came with the template. Any suggestions and contributions are greatly appreciated.

TRY Justineo/vue-octicon FIRST!

Installation

NPM

 npm install vue-octicons

Loading the component


// Registers the component globally.
Vue.component('octicon', require('vue-octicons/src/components/Octicon.vue'));

Using the component

The <octicon> component will output an <svg> tag. In order for an icon to appear you must include icon-name attribute. The icon name much match the symbol of an octicon.

By default the following attributes are set on the <svg> tag:

  • version="1.1"
  • aria-hidden="true"
  • role="presentation"

By default the the following classes are added to the class attribute of the <svg> tag:

  • octicon
  • octicon-[icon name]

In an effort to keep the usage of octicons similar to the usage of FontAwesome icons the height, width and viewBox attributes are calculated based on the container's font size.

The viewBox attribute is set to '0 0 svg-width svg-height'. The svg-width and height are the dimensions of the icon within the svg path.

The height attribute is set to the font-height of the <svg>.

The width attribute is calculated multiplying height by the aspect ratio of the icon.

    width = height * (svg-width / svg-height);

Build Setup

# serve with hot reload at localhost:8080npm run dev
# build demo with minificationnpm run build
# build demo and view the bundle analyzer reportnpm run build --report
# run unit tests - currently just template sample tests.npm run unit
# run e2e tests - currently just template sample tests.npm run e2e
# run all tests - currently just template sample tests.npm test

For detailed explanation on how things work, checkout the guide and docs for vue-loader.