{"id":35165436,"url":"https://github.com/saitogo555/initial-logo.js","last_synced_at":"2026-04-01T23:38:44.267Z","repository":{"id":330857074,"uuid":"1123030787","full_name":"saitogo555/initial-logo.js","owner":"saitogo555","description":"Generate JavaScript/TypeScript style logo","archived":false,"fork":false,"pushed_at":"2026-03-22T14:25:14.000Z","size":191,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-22T15:09:51.430Z","etag":null,"topics":["initial","javascript","logo","typescript"],"latest_commit_sha":null,"homepage":"https://saitogo555.github.io/initial-logo.js/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saitogo555.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-26T04:03:23.000Z","updated_at":"2026-03-22T14:25:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/saitogo555/initial-logo.js","commit_stats":null,"previous_names":["saitogo555/initial-logo.js"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/saitogo555/initial-logo.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saitogo555%2Finitial-logo.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saitogo555%2Finitial-logo.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saitogo555%2Finitial-logo.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saitogo555%2Finitial-logo.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saitogo555","download_url":"https://codeload.github.com/saitogo555/initial-logo.js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saitogo555%2Finitial-logo.js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["initial","javascript","logo","typescript"],"created_at":"2025-12-28T19:29:18.483Z","updated_at":"2026-04-01T23:38:44.260Z","avatar_url":"https://github.com/saitogo555.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# initial-logo.js\n\n![banner](images/banner.webp)\n\n[🇺🇸 English](README.md) | [🇯🇵 日本語](docs/README.ja.md)\n\n![npm version](https://img.shields.io/npm/v/initial-logo)\n\nGenerate JavaScript/TypeScript style logos (up to 2 characters inside a square) easily.\n\n## Features\n\n- 🎨 **Customizable**: Change colors, size, fonts, border radius, text anchor, and more.\n- 🌈 **Gradients**: Support for linear/radial gradient backgrounds and text.\n- 🔤 **Custom Fonts**: Load fonts from any URL or local file (WOFF2/TTF).\n- ⚡ **Lightweight**: Zero dependencies for the core logic.\n- 🖼️ **Multiple Formats**: Generate SVG strings (core), or PNG/JPG/WEBP via the Node.js adapter.\n\n## Installation\n\n```bash\nbun add initial-logo\n# or\nnpm install initial-logo\n```\n\n## Usage\n\n### Generate SVG String\n\n```typescript\nimport { generateRawSvg } from 'initial-logo';\n\n// Basic usage\nconst svgString = await generateRawSvg({\n  text: 'TS',\n  size: 100,\n  textColor: '#ffffff',\n  backgroundColor: '#3178c6',\n});\n\n// Use in an \u003cimg\u003e tag via data URL\nconst dataUrl = `data:image/svg+xml;base64,${btoa(svgString)}`;\n```\n\n### Gradient Example\n\n```typescript\nconst svgString = await generateRawSvg({\n  text: 'GR',\n  textColor: ['#ff0000', '#0000ff'],          // linear gradient text\n  backgroundColor: ['#222222', '#444444'],    // linear gradient background\n  textGradientType: 'linear',                 // 'linear' (default) | 'radial'\n  backgroundGradientType: 'linear',\n});\n```\n\n### Node.js Adapter (PNG / JPG / WEBP)\n\n```typescript\nimport { generatePng, generateJpg, generateWebp } from 'initial-logo/adapters/node';\n\nconst pngBuffer  = await generatePng({ text: 'TS', backgroundColor: '#3178c6' });\nconst jpgBuffer  = await generateJpg({ text: 'JS', backgroundColor: '#f7df1e' }, 90);\nconst webpBuffer = await generateWebp({ text: 'DN', backgroundColor: '#000000' }, 90);\n```\n\n\u003e The Node.js adapter depends on [sharp](https://sharp.pixelplumbing.com/). It is included in the package dependencies.\n\n## CLI Usage\n\n```bash\n# Generate SVG (default output: initial-logo.svg)\nnpx initial-logo -t TS\n\n# Customize colors and size\nnpx initial-logo -t JS -s 200 --textColor \"#000000\" --backgroundColor \"#f7df1e\" -o js-logo.svg\n\n# Gradient\nnpx initial-logo -t GR \\\n  --textColor \"#ff0000\" --textColor \"#0000ff\" \\\n  --backgroundColor \"#222222\" --backgroundColor \"#444444\" \\\n  -o gradient.svg\n\n# Export as PNG\nnpx initial-logo -t TS -o logo.png\n\n# Rounded corners, custom font weight, text anchor\nnpx initial-logo -t TS -r 16 -w 700 -a bottom-right -o logo.svg\n```\n\n### CLI Options\n\n| Option | Alias | Description | Default |\n|---|---|---|---|\n| `--text` | `-t` | Logo text — up to 2 graphemes (required) | - |\n| `--size` | `-s` | Logo size in pixels | `100` |\n| `--output` | `-o` | Output path (`.svg` / `.png` / `.jpg` / `.webp`) | `initial-logo.svg` |\n| `--textColor` | `-T` | Text color — repeat for gradient | `#ffffff` |\n| `--backgroundColor` | `-B` | Background color — repeat for gradient | `#000000` |\n| `--textGradientType` | | Text gradient type: `linear` \\| `radial` | `linear` |\n| `--bgGradientType` | | Background gradient type: `linear` \\| `radial` | `linear` |\n| `--fontSource` | `-f` | Font URL or local file path | Raleway 700 (jsDelivr) |\n| `--fontSize` | `-F` | Font size in pixels | `Math.round(size * 0.525)` |\n| `--fontWeight` | `-w` | Font weight | `700` |\n| `--borderRadius` | `-r` | Border radius in pixels | `0` |\n| `--textAnchor` | `-a` | Text anchor position (see below) | `center` |\n| `--help` | `-h` | Display help message | - |\n\n**`--textAnchor` values**: `top-left` \\| `top` \\| `top-right` \\| `left` \\| `center` \\| `right` \\| `bottom-left` \\| `bottom` \\| `bottom-right`\n\n## API\n\n### `generateRawSvg(options: LogoOptions): Promise\u003cstring\u003e`\n\nGenerates a logo as an SVG string. This is the primary export of the core library.\n\n#### `LogoOptions`\n\n| Property | Type | Default | Description |\n|---|---|---|---|\n| `text` | `string` | **(Required)** | Logo text — up to 2 graphemes (supports emoji, CJK, etc.). |\n| `size` | `number` | `100` | Size of the square in pixels. Must be a positive finite number. |\n| `textColor` | `string \\| string[]` | `'#ffffff'` | Text color. Pass an array of 2+ colors for a gradient. |\n| `textGradientType` | `'linear' \\| 'radial'` | `'linear'` | Gradient type for text. Applies only when `textColor` is an array. |\n| `backgroundColor` | `string \\| string[]` | `'#000000'` | Background color. Pass an array of 2+ colors for a gradient. |\n| `backgroundGradientType` | `'linear' \\| 'radial'` | `'linear'` | Gradient type for background. Applies only when `backgroundColor` is an array. |\n| `fontSource` | `string \\| ArrayBuffer` | Raleway 700 (jsDelivr CDN) | Font URL or `ArrayBuffer` of a WOFF2/TTF font. |\n| `fontSize` | `number` | `Math.round(size * 0.525)` | Font size in pixels. |\n| `fontWeight` | `string \\| number` | `700` | Font weight passed to the font renderer. |\n| `borderRadius` | `number` | `0` | Corner radius of the square in pixels. |\n| `textAnchor` | `TextAnchorPosition` | `'center'` | Position of the text within the square. |\n\n### Node.js Adapter\n\nImport from `initial-logo/adapters/node`.\n\n#### `generatePng(options: LogoOptions): Promise\u003cBuffer\u003e`\n\n#### `generateJpg(options: LogoOptions, quality?: number): Promise\u003cBuffer\u003e`\n\n`quality` defaults to `90`.\n\n#### `generateWebp(options: LogoOptions, quality?: number): Promise\u003cBuffer\u003e`\n\n`quality` defaults to `90`.\n\n### Types\n\n```typescript\ntype TextAnchorPosition =\n  | 'top-left' | 'top' | 'top-right'\n  | 'left'     | 'center' | 'right'\n  | 'bottom-left' | 'bottom' | 'bottom-right';\n\ntype GradientType = 'linear' | 'radial';\n```\n\n## Development\n\n```bash\n# Install dependencies\nbun install\n\n# Start playground\nbun run playground\n\n# Run tests\nbun run test\n\n# Build\nbun run build\n```\n\n## Disclaimer\n\nThis 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.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaitogo555%2Finitial-logo.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaitogo555%2Finitial-logo.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaitogo555%2Finitial-logo.js/lists"}