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 🙏

© 2026 – Pkg Stats / Ryan Hefner

initial-logo

v0.4.0

Published

Generate JavaScript/TypeScript style logo

Readme

initial-logo.js

[!WARNING] Beta Version: This project is currently in beta. APIs are subject to change without notice.

🇺🇸 English | 🇯🇵 日本語

Generate JavaScript/TypeScript style logos (2 characters inside a square) easily.

Features

  • 🎨 Customizable: Change colors, size, fonts, and more.
  • 🌈 Gradients: Support for gradient backgrounds and text.
  • 🔤 Custom Fonts: Easily load fonts from Google Fonts or other sources.
  • Lightweight: Zero dependencies for the core logic.
  • 🖼️ Multiple Formats: Generate HTML Divs, SVG strings, SVG Elements, or data URLs.

Installation

bun add initial-logo
# or
npm install initial-logo

Usage

import {
  generateLogo,
  generateRawSvg,
  generateSvgDataUrl,
  generateSvgElement,
} from 'initial-logo';

// Generate HTML Div Element
const logo = generateLogo({
  text: 'TS',
  size: 100,
  textColor: '#ffffff',
  backgroundColor: '#3178c6',
});
document.body.appendChild(logo);

// Generate SVG String
const svgString = generateRawSvg({
  text: 'JS',
  textColor: '#000000',
  backgroundColor: '#f7df1e',
});

// Generate SVG Data URL string (usable in img/src, CSS, etc.)
const dataUrl = generateSvgDataUrl({
  text: 'DN',
  textColor: '#ffffff',
  backgroundColor: '#000000',
});

// Generate SVG Element
const svgElement = generateSvgElement({
  text: 'JS',
  textColor: '#000000',
  backgroundColor: '#f7df1e',
});
document.body.appendChild(svgElement);

Gradient Example

const gradientLogo = generateLogo({
  text: 'GR',
  textColor: ['#ff0000', '#0000ff'], // Gradient text
  backgroundColor: ['#222222', '#444444'], // Gradient background
});

CLI Usage

You can also use the CLI to generate logos directly from the terminal.

# Generate a logo and save to file
npx initial-logo -t TS -o logo.svg

# Customize colors and size
npx initial-logo -t JS -s 200 --textColor "#000000" --backgroundColor "#f7df1e" -o js-logo.svg

# Gradient example
npx initial-logo -t GR --textColor "#ff0000" --textColor "#0000ff" --backgroundColor "#222222" --backgroundColor "#444444" -o gradient.svg

Note: If --output is not specified, the CLI writes the generated SVG to initial-logo.svg in the current directory.

# Generate using default output filename
npx initial-logo -t TS
# This will create ./initial-logo.svg

Options

| Option | Alias | Description | Default | |---|---|---|---| | --text | -t | Logo text (required) | - | | --size | -s | Logo size in pixels | 100 | | --output | -o | Output file path | initial-logo.svg | | --textColor | -T | Text color (repeat for gradient) | #ffffff | | --backgroundColor | -B | Background color (repeat for gradient) | #000000 | | --fontSource | -f | Font source URL | - | | --fontSize | -F | Font size | - | | --help | -h | Display help message | - |

API

generateLogo(options: LogoOptions): HTMLDivElement

Generates a logo as an HTML div element.

generateRawSvg(options: LogoOptions): string

Generates a logo as an SVG string.

generateSvgDataUrl(options: LogoOptions): string

Generates a logo as a data URL string (data:image/svg+xml;...).

generateSvgElement(options: LogoOptions): SVGElement

Generates a logo as an SVG DOM element.

LogoOptions

| Property | Type | Default | Description | |---|---|---|---| | text | string | (Required) | Exactly 2 characters to display. | | size | number | 100 | Size of the square in pixels. | | textColor | string \| string[] | '#ffffff' | Text color. Pass an array for gradient. | | backgroundColor | string \| string[] | '#000000' | Background color. Pass an array for gradient. | | fontSource | string | (Embedded JetBrains Mono) | URL to load the font from (WOFF2 format recommended). | | fontFamily | string | (Auto-generated) | Font family name to use. | | fontSize | number | Math.round(size * 0.65) for HTML, Math.round(size * 0.525) for SVG | Font size in pixels. | | fontWeight | string \| number | '800' | CSS font-weight. | | lineHeight | string \| number | 0.8 | CSS line-height. |

Development

# Install dependencies
bun install

# Start playground
bun run playground

# Build
bun run build

Disclaimer

This tool is an unofficial project and is not affiliated with, endorsed by, or connected to Oracle, Microsoft, or the OpenJS Foundation. Users are solely responsible for the trademark and copyright compliance of any logos generated using this tool.

License

MIT