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

jostraca

v0.38.0

Published

Jostraca template generator.

Readme

jostraca

A code and project generator. You describe an output file tree with components—Project, Folder, File, Content and the rest—inside a callback, and Jostraca writes the tree to disk. The callback runs first and touches nothing; only then does the build phase write files. That split is why a second run over code somebody has edited by hand can preserve, present, diff or merge instead of overwriting.

No template syntax to learn. Either write code—iteration is for, branching is if, reuse is a function—or mark up a file that is still valid source, with the marker inside the target language's own comment syntax, so <!-- <[SLOT:head]> --> stays valid HTML and // <[SLOT:head]> stays valid Go. The template opens, highlights, formats, and lints like any other file of its type. $$path$$ substitutes a model value and does nothing else: no conditionals, no loops, no expressions.

This is the canonical TypeScript implementation, published to npm as jostraca. A feature-parity Go port lives at github.com/jostraca/jostraca/go.

npm version license

npm install jostraca

shape is the only peer dependency, and npm installs it for you. It validates options, on a loose range (shape >=11). In-memory generation is served by an in-repo filesystem (src/util/memfs.ts), so nothing else is installed for it.

A generator, end to end

import { Jostraca, Project, Folder, File, Content } from 'jostraca'

const jostraca = Jostraca({ model: { app: { name: 'acme' } } })

await jostraca.generate({ folder: './out' }, () => {
  Project({ folder: 'acme' }, () => {

    File({ name: 'package.json' }, () => {
      Content('{ "name": "$$app.name$$" }\n')
    })

    Folder({ name: 'src' }, () => {
      File({ name: 'index.js' }, () => {
        Content('console.log("$$app.name$$")\n')
      })
    })
  })
})

Run it and out/acme/ holds package.json and src/index.js, with $$app.name$$ replaced from the model.

Documentation

The documentation set lives in docs/ at the repository root, and is rendered at jostraca.org, in four kinds:

Every example in those pages is executed by ts/test/docs.test.ts, which runs each snippet in a temp directory and compares the tree it wrote.

Build and test

cd ts
npm install     # also pulls the peer dep: shape
npm run build   # tsc --build src test
npm test        # node --test dist-test/**/*.test.js

From the repository root, make all builds and tests both the TypeScript and Go stacks. TypeScript is the source of truth: change it first, then bring Go into parity. See go/README.md for the port.

License

MIT. Copyright (c) Richard Rodger. See LICENSE.