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

@yiliang114/social-assist-core

v0.0.1

Published

`@yiliang114/social-assist-core` 是一个纯逻辑包,用来承载 `social-assist` 的可复用部分,不依赖 Nest,也不负责数据库持久化。

Downloads

98

Readme

social-assist-core

@yiliang114/social-assist-core 是一个纯逻辑包,用来承载 social-assist 的可复用部分,不依赖 Nest,也不负责数据库持久化。

适合什么时候用

适合:

  • 其他 Node 服务想直接生成 GitHub / X / 小红书草稿
  • 想复用 hashtag 归一化、X compose URL、模板库读取
  • 不需要直接依赖 nest-api 的数据库和 HTTP 层

不适合:

  • 你需要历史草稿持久化
  • 你需要统一走 nest-api 的鉴权和接口
  • 你需要热点机会抓取接口

这些场景应该调 nest-apisocial-assist 接口,而不是直接用这个包。

当前导出

当前主入口:

  • buildSocialDraftPack
  • renderDraftPackMarkdown
  • normalizeHashtags
  • buildXComposeUrl
  • buildXClipboardText
  • buildXiaohongshuDraft
  • listSocialAssistTemplates

最小示例

import { buildSocialDraftPack } from '@yiliang114/social-assist-core'

const pack = buildSocialDraftPack({
  authorLogin: 'yiliang114',
  repository: 'org/repo',
  source: 'github_pr',
  tone: 'professional',
  title: 'Ship social assist studio',
  summary: '前后端已经打通,并支持历史草稿恢复。',
  url: 'https://github.com/org/repo/pull/123',
  hashtags: ['opensource', 'workflow'],
})

console.log(pack.github.recommendedText)
console.log(pack.x.composeUrl)
console.log(pack.xiaohongshu.draftBody)

模板库示例

import { listSocialAssistTemplates } from '@yiliang114/social-assist-core'

const result = await listSocialAssistTemplates({
  libraryDir: 'scripts/ts/social-assist/library',
  kind: 'x_reply',
  limit: 8,
})

console.log(result.items)

推荐的复用分层

1. 纯逻辑复用

直接依赖本包。

适合:

  • CLI
  • worker
  • 独立 Node 服务

2. 统一能力复用

nest-apisocial-assist HTTP 接口。

适合:

  • 多前端共用同一套行为
  • 需要统一鉴权
  • 需要历史记录和数据库

3. 同仓库 Nest 模块复用

如果你就在本仓库内,并且需要持久化和模板服务,优先直接复用 SocialAssistModule,不要在 Nest 服务里重复造 HTTP 调用。