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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sassywares/crust

v1.1.3

Published

Batteries included boilerplate for painless TypeScript library development — By the Sassywares team

Downloads

209

Readme

Crust

🍞 Crust

TypeScript library boilerplate with Vite, Release-It, and GitHub Actions • by the sassywares team.

Table of Contents

Features

Crust comes with all you need to instantly ship a TypeScript library, no more reinventing the wheel.

Vite

Vite comes with a library mode, which allows you to export a standalone version of your app that can be published to NPM and used by consumers without any additional configuration. This is enabled in Crust already, in the vite.config.ts file.

export default defineConfig({
  build: {
    lib: {
      name: "Crust",
      entry: resolve(__dirname, "src/index.ts"),
      fileName: "index",
    },
  },
});

With this, just a simple pnpm build will build and output the library to the dist directory. An additional plugin named vite-plugin-dts is used to generate the TypeScript declaration files, which are also output to the dist directory. This allows your consumers to actually infer the types of the library, which is the whole point of TypeScript.

Release-It

Release-It is a really cool tool that helps you automate the semver versioning of your library. It's configured in the .release-it.json file with an additional plugin named release-it-pnpm which allows working with pnpm a breeze, and it's used to generate the changelog, bump the version, create a GitHub release, and publish the library to NPM.

GitHub Actions

An action is setup in the .github/workflows/release.yml file to build and publish the library to NPM whenever you want to release a new version. Right now, the action is set to run on workflow_dispatch which means you can manually trigger it from the GitHub UI, but you can change it to run on a schedule if you want.

For instance, if you want to release on each push to the main branch, you can:

on:
  push:
    branches:
      - main

Or if you want to release on each new tag, you can:

on:
  release:
    types:
      - created

You can learn more about the GitHub Actions workflow syntax here.

Getting started

Clone the repo or use it as a template to create your own. Then, follow the instructions below to get started.

Install the dependencies:

pnpm install

Start the development server:

pnpm dev

Build the app:

pnpm build

Release a new version and publish to NPM:

pnpm release

Where to write code

Your library's code goes inside the src/lib directory. Each module you want available to the consumers should be exported from the src/index.ts file. This allows you to granularly export what you want, and what you don't.

How to publish the library

Crust provides you 2 ways to publish the library to NPM:

  1. pnpm release

This will build the library, generate the changelog, bump the version, create a GitHub release, and publish the library to NPM. Note that this will fail if you aren't signed in to NPM in your terminal session. This is good for when you're the only one working on the library.

  1. GitHub Actions

From the GitHub Actions UI, you can trigger the Release workflow, which will do all that's listed above. Only catch here is that you need to first add a token from NPM with write-access to the repository secrets. The token name must match the one specified as the NODE_AUTH_TOKEN in the workflow file. A sophisticated guide on how to add a token to the repository secrets can be found here.

How to install the library

Once published to NPM, you can install the library in your project by the basic pnpm add command. For example, if you published the library to NPM as @sassywares/crust, you can install it in your project by running:

pnpm add @sassywares/crust

And then use in your project:

import { sum } from "@sassywares/crust";

console.log(sum(1, 2));

sum will be typed as well since we're exporting the declaration files using the vite-plugin-dts plugin.

Philosophy

The reason why I made Crust was because I like re-using the code I write, because I don't like reinventing the wheel. Maybe you're building a multi-repo app that has to re-use something, use crust and ship that something as a standalone library. Maybe you just want to make something useful available to everyone with a single command, Crust has you covered.

Roadmap

Here's what's planned for future releases:

  • [ ] Add testing setup with Vitest
  • [ ] Add more test examples and testing utilities
  • [ ] Add automated code quality checks (code coverage, complexity analysis)
  • [ ] Create templates for different types of libraries (React components, Node.js utilities, etc.)

You made it to the end? Mad props 🤘

If you have any ideas or suggestions, please let me know. This is an open-source project and all contributions are welcome. You can reach out to me on LinkedIn or my email.