0.1.3 • Published 9 months ago

@m234/nerd-fonts v0.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

@m234/nerd-fonts

npm version npm downloads github github issues

Get Nerd Fonts glyph icon character using a CSS class name or a file path with an extension.

Features

  • Get Nerd Fonts icons by css class names: 10K+ icons.
  • Give a file path or a parsed object - get icon. Seti theme support with colors.
  • Built-in typescript declarations.

Install

npm i @m234/nerd-fonts

Usage

import nf from "@m234/nerd-fonts";
import chalk from "chalk";

// # Class-name icon
const icon = nf.icons['nf-md-weather_lightning']
console.log(`Weather: ${icon.char}`); // Weather: 󰖓

// # File icon (seti)
const file = 'example/index.js';
const ficon = nf.FSC.fromPath(file, nf.FSC.mappings.seti);
console.log(`Icon ${ficon.char} for ${file}`); // Icon  for example/index.js

// # Colored
const colorHex = ficon.color.toString(16)
const colorize = chalk.hex(colorHex)
console.log(`Icon ${colorize(ficon.char)} for ${file}`); // Icon  for example/index.js
0.1.2

10 months ago

0.1.3

9 months ago

0.1.1

10 months ago

0.1.0

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago