制作我的npx名片
Building my npx business card

原始链接: https://ashley.dev/posts/turning-feedback-into-features/

Ashley Willis 最初在其网站 ashley.dev 上使用了 "npx connect",意在俏皮地邀请大家联系她。然而,评论员 Tierney Cyren 指出这可能会让开发者误以为这是一个功能性命令。这引发了一个更好的主意:创建一个 npm 卡片。 受 Tierney 之前作品的启发,Ashley 创建了一个基于终端的电子名片,可以通过 `npx ashleywillis` 访问。这个小型 Node.js 项目使用了 `chalk` 和 `boxen` 等库来显示一个样式化的名片,其中包含她的姓名、职位和社交链接,直接显示在终端中。这个过程包括定制卡片的内容、颜色和布局以反映她的个性。 将这个包发布到 npm 允许任何人通过终端立即联系她,展示了她创造力和技术技能的结合。这个项目很好地说明了,即使在技术领域,一些细微的、贴心的设计也能提升开发者体验并建立有意义的人际联系。它强调了协作、反馈和享受细节乐趣的重要性。

Hacker News 最新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 构建我的 npx 名片 (ashley.dev) 3 分 edent 2 小时前 | 隐藏 | 过去 | 收藏 | 2 条评论 neilv 15 分钟前 | 下一条 [–] 这些 npx 名片会在你的电脑上运行任意代码吗? 回复 steele 17 分钟前 | 上一条 [–] 哦,免费的房地产,让我们殖民和改善包管理 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系我们 搜索:

原文

While I was building ashley.dev, I wanted it to feel genuine, more like a reflection of me, and less like a standard portfolio. One of the sections I added to the About page said npx connect above a set of social icons. In my mind, it was just a playful callout, a nod to the idea of connecting through different platforms.

But when Tierney Cyren reviewed the site (and I’m incredibly grateful they did), they pointed something out: from a developer’s perspective, seeing npx connect might imply that there’s a real npx command you could run. Not only would that be confusing, it actually wouldn’t work at all. And if there’s one thing developers are good at, it’s noticing when something feels broken.

That simple review didn’t just catch a small mistake, it sparked something bigger. Rather than just brushing it off, Tierney introduced me to something they had built a few years earlier: npm cards. It’s a clever way to publish a small, custom business card that someone could run directly in the terminal.

It was one of those moments where thoughtful feedback made everything better and reminded me why I love this community so much.

Why a Terminal Business Card?

One of the things I’ve always loved about developer culture is how it blends creativity with craft. Little touches, like a CLI-based business card, turn something technical into something personal. It’s a small way of saying, “Hey, behind this code, there’s a human.”

When Tierney showed me npm cards, it immediately inspired me. Not only could I make the About section on ashley.dev more intentional, but I could also give people a way to connect with me that felt a little more surprising and a little more me.

There’s something delightful about typing a command like npx ashleywillis into your terminal and having it greet you with a card. No installs. No websites. Just an instant connection, right in the place developers spend a good chunk of their time.

How It Works: Behind the Scenes

At its heart, an npm card is a small Node.js project that outputs styled text when run with npx.

The basic flow looks like this:

  • Publish a package to npm.
  • Define a bin script in your package.json that tells npx what to execute.
  • Use libraries like chalk (for colors) and boxen (for layout) to make the output clean, colorful, and readable.

Tierney’s npm-card project took care of the heavy lifting, so I didn’t have to start from scratch. I cloned the project, customized the content, swapping in my name, my role, my social links, and played around with the formatting until it felt right.

What I loved most was how lightweight it all was. The project itself is tiny, but it creates a meaningful little experience for anyone curious enough to run the command.

Building and Customizing My Card

Once I had the basic structure in place, the fun part started: making it feel like mine.

I began by swapping out the default text for something that felt personal but still clear. I included my name, my role, and a few links where people could find me online, enough to be helpful without overwhelming the tiny space.

Since the terminal can feel a little stark on its own, I leaned into color. Using chalk, I could add just enough styling to make certain parts pop: my name in one color, links in another, subtle accents to make it easy to read without looking chaotic.

I also adjusted the box layout with boxen, giving the card a clear, clean frame that made the content feel deliberate. Tiny things, like choosing the padding, the border style, and the background color, added up to something that felt intentional.

Honestly, it was the kind of project that reminded me how much joy there is in the details.

Even deciding whether the text should wrap at 50 characters or 60 felt important, because in a space that small, every choice affects the experience.

Publishing It to the World

After customizing the card, the final step was to publish it so that anyone could run it.

I made sure the package.json included all the right metadata, the name, the bin field pointing to my executable file, and a few keywords so people could find it (if they happened to stumble onto it on npm).

Then it was just a matter of pushing it to npm with:

npm publish

The first time I typed npx ashleywillis into my terminal and saw the finished card pop up, it genuinely made me smile.

It wasn’t a massive app or a complicated build. It was a small thing, made with care, and somehow that made it even better. After that, I went back to my Astro site, updated the About section with something that actually worked: npx ashleywillis

It felt good to close the loop and even better to know that if another developer ever got curious, they’d find a little easter egg waiting for them.

Why These Tiny Projects Matter

It’s easy to think of small projects like this as just “extra”, little things you squeeze in between bigger milestones. But honestly, I think they’re some of the most meaningful things we build.

Projects like this remind me that developer experience isn’t just about frameworks and APIs, it’s about moments of human connection, even in the most technical spaces.

It’s about caring enough to make something thoughtful, even if nobody ever sees it but you and a handful of curious developers.

In a way, building my npm card was a perfect reflection of what I try to carry into all my work: Make it approachable. Make it human. Make it a little bit joyful.

And if someone smiles when they run npx ashleywillis, even just a little? That’s a win.

Most of all, it’s a reminder that the best parts of building things often come from building them together, from asking for help, listening to feedback, and finding delight in the smallest details.

Try It Yourself

If you want to see it in action, you can run:

npx ashleywillis

Or you can check out the repo here if you’re curious about how it’s built!

And if you end up making your own, send it my way. I’d love to see it.

联系我们 contact @ memedata.com