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

@lacspace/hookwriter

v1.1.0

Published

Deterministic platform copy from facts — hooks, titles, captions, CTAs and descriptions in many styles (question, number-led, what-it-means, contrast, breaking, how-to, quote…), English and Nepali, trimmed to each platform's character limit (YouTube/IG/Ti

Downloads

489

Readme

@lacspace/hookwriter

Platform-ready copy from facts — hooks, titles, captions, CTAs and descriptions, in many styles, English and Nepali. Deterministic: it fills templates with only the facts you pass (never invents a claim), trims to each platform's character limit, and drops sensational phrasing. AI is optional — only to fill slots.

npm i @lacspace/hookwriter
import { generate, compose } from "@lacspace/hookwriter";

const facts = {
  topic: "the rate cut",
  headline: "Nepal Rastra Bank cuts the policy rate",
  place: "Nepal", number: "4.5%",
  hashtags: ["NRB", "economy", "Nepal"],
};

generate(facts, { type: "hook", platform: "instagram", lang: "both" });
// → [{ style:"plain", lang:"ne", text:"…" }, { style:"number", lang:"en", text:"4.5% …" }, …]  (no BREAKING unless urgency:"breaking")

compose(facts, { platform: "instagram", lang: "en" }).text;
// → hook + caption + CTA + #NRB #economy #Nepal, fitted to 2200 chars

Why

A newsroom needs a caption/title for every post on every platform — doing that with an LLM each time is slow, costly, and risks drift or hype. hookwriter stamps out on-brand, factual copy deterministically, and leaves the LLM only the occasional slot to fill.

API

  • generate(facts, { type, platform, lang?, styles?, max? }) → Variant[] — many variants of one copy type (hook | title | caption | cta | description), each { style, lang, text, length }. A template whose slots aren't all present in facts is skipped — nothing is fabricated — and anything sensational is dropped. Output is trimmed to the platform's limit.
  • compose(facts, { platform, lang?, style?, urgency?, cta?, maxHashtags? }) → { hook, caption, hashtags, text } — a full post assembled from the parts, hashtags capped per platform (30 on Instagram), fitted to the caption limit.
  • slotTemplates(type, lang) → the raw templates with their {slots}, so an LLM can fill the slots itself (the only place AI is needed).
  • describe() → machine-readable capabilities + JSON-Schema commands + the lists of types, styles and platforms, so an AI "conductor" drives it by choosing options.
  • PLATFORMS / limitFor / fitText — the platform limits and the word-boundary trimmer, exported.

Urgency (1.1.0): "BREAKING:" / "Just in" / "ताजा खबर:" copy appears only with urgency: "breaking" (or styles: ["breaking"]); routine stories (the default) never get it, in generate or compose.

Styles: plain, question, number, whatItMeans, contrast, curiosity, breaking, howto, quote, list. Platforms: YouTube, Instagram, TikTok, Facebook, X, Threads, LinkedIn, Telegram. Pair it with @lacspace/extractive (facts/headlines) upstream.

Licence

Lacspace Free Licence v1.0 — free for personal and commercial use.