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

sxl-code-buddy

v0.0.4

Published

A simple CLI for generating and displaying buddy sprites

Readme

sxl-code-buddy

一个轻松有趣的终端宠物生成器。

它可以在命令行里随机生成一只像素风 ASCII Buddy,带有:

  • 不同物种
  • 不同稀有度
  • 不同眼睛 / 帽子
  • 属性值与表情
  • 本地存档
  • 简单动画预览

非常适合拿来做:

  • 终端小玩具
  • npm CLI Demo
  • ASCII / Sprite 生成示例
  • 随机宠物生成器

Features

  • 支持命令行交互模式
  • 支持按 userId 稳定生成同一只宠物
  • 支持按 seed 复现结果
  • 支持随机单抽
  • 支持保存 / 读取 / 删除本地宠物存档
  • 支持程序化调用,既能当 CLI 用,也能当库用

Install

全局安装:

npm install -g sxl-code-buddy

项目内使用:

npm install sxl-code-buddy

直接运行:

npx sxl-code-buddy

Quick Start

进入交互模式:

buddy

随机抽一只:

buddy --once

按种子生成:

buddy --seed myseed

按用户 ID 稳定生成:

buddy --user alice

播放动画预览:

buddy --seed myseed --animate

指定本地存档文件:

buddy --save-file ./data/my-buddy.json

LAN Online (Experimental)

This project includes an optional LAN server (TCP/NDJSON) on port 4432.

Start server:

buddy-server

Join/host from the client:

  • Run buddy and choose Online / LAN in the interactive menu.

pm2 Hosting

Build first:

npm run build

Start with pm2:

pm2 start ecosystem.config.cjs
pm2 save

CLI Options

| 参数 | 说明 | | --- | --- | | --user <id> | 基于用户 ID 稳定生成宠物 | | --seed <seed> | 基于 seed 复现同一只宠物 | | --once | 随机生成一只 | | --save-file <path> | 指定本地存档文件路径 | | --list-species | 查看支持的物种 | | --list-eyes | 查看支持的眼睛样式 | | --list-hats | 查看支持的帽子样式 | | --animate | 显示动画预览 | | -h, --help | 查看帮助 |


Example

========================================
🐾 你的宠物
========================================

物种: cat
稀有度: 🟡 金色
稀有值: 50
眼睛: o
帽子: crown
闪光: 否
灵感种子: 123456789

属性:
  DEBUGGING    82 ████████
  PATIENCE     61 ██████
  CHAOS        27 ███
  WISDOM       74 ███████
  SNARK        49 █████

表情: =o蠅o=

Programmatic Usage

import {
  roll,
  rollRandom,
  rollWithSeed,
  renderFace,
  renderSprite,
  saveRollToFile,
  loadSavedRoll,
} from 'sxl-code-buddy'

const fixed = roll('alice')
const seeded = rollWithSeed('demo-seed')
const random = rollRandom()

console.log(fixed.bones.species)
console.log(renderFace(seeded.bones))
console.log(renderSprite(random.bones).join('\n'))

await saveRollToFile(random, './buddy-pet.json')
const saved = await loadSavedRoll('./buddy-pet.json')
console.log(saved?.roll.bones.rarity)

Exports

这个包同时导出了生成、渲染和存档能力:

  • roll
  • rollRandom
  • rollWithSeed
  • renderFace
  • renderSprite
  • spriteFrameCount
  • saveRollToFile
  • loadSavedRoll
  • deleteSavedRollFile
  • SPECIES
  • EYES
  • HATS

Save File

默认存档文件为:

./buddy-pet.json

保存内容是可读 JSON,适合调试和二次处理。


Use Cases

  • 给每个用户分配一只固定 Buddy
  • 给 CLI 工具加一个有趣的欢迎角色
  • 在终端里做小游戏 / 彩蛋
  • 做随机角色、宠物或像素素材原型

Development

安装依赖:

npm install

构建:

npm run build

开发监听:

npm run watch

本地运行:

npm start

License

MIT