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

@sapper-dragon/trimmings

v0.1.4

Published

Decorate your Sapper project with some holiday spirit.

Readme

sapper-trimmings

Decorate your Sapper project with some (optional) holiday spirit.

This package is a grab bag of useful "plugins" for Sapper. These tools are all employed in a very specific and opinionated manner. The packages are all broken up into specific sub-packages, like so:

NOTE: this lib only works with Svelte v3, Sapper 0.26.0+, and Rollup. You've been warned. 🐉

Installation

npm install @sapper-dragon/trimmings --save-dev
# or
yarn add @sapper-dragon/trimmings --dev

Usage

Watch various Sapper helper tools through the command line:

trim watch [options]

Options

-p, --postcss     Use PostCSS for preprocessing  (default false)
-s, --svgo        Use SVGO compiler for svgs  (default false)
-r, --remark      Use Remark compiler for markdown  (default false)
-l, --lilypond    Use LilyPond compiler for sheet music  (default false)

package.json script

I'm using an NPM/Yarn package.json script like so (including any desired options):

"watch": "trim watch --postcss --svgo --remark --lilypond"

Config

You can place a trimmings.config.js file in the root of your project to set configutations. Individual configurations can be found in each @sapper-dragon/* package, but the basic format is like so:

export default {
	postcss: {/* ...see @sapper-dragon/postcss package... */},
	svgo: {/* ...see @sapper-dragon/svgo package... */},
	remark: {/* ...see @sapper-dragon/remark package... */},
	// etc.
}

LiveReload

When using any of these tools, a file is generated for the use of triggering LiveReload. This file is generated on startup, as well as everytime a change is made to any of the given files associated with the tools (*.css, *.svg, or *.md). The file is ./src/routes/_refresh.svelte. You should add this to your .gitignore file:

/src/routes/_refresh.svelte

If you want this to actually trigger LiveReload, add it somewhere in your actual layout. I'm doing the following in _layout.svelte:

<!-- DEV ONLY -->
{#if Refresh}
	<svelte:component this={Refresh}/>
{/if}
<script>
	import { onMount } from 'svelte'
	let Refresh = false
	onMount(async() => {
		if (process.env.NODE_ENV === 'development') {
			Refresh = (await import('./_refresh.svelte')).default
		}
	})
</script>

The file is just a hidden component with an id that changes to invalidate and refresh.

Q&A

Q: Why not rollup-plugin-*?

A: Partly because I wanted tighter control, partly because Rollup isn't always easy to do wild and crazy things, and partly because this is just that, a grab bag of all sorts of reusable goods. If this lib gets a lot of usage, and people can point out how rollup-plugin-* is better, I'm all ears. Admittedly, this is a little bit reckless and built from scratch wizardry. Also, for the PostCSS preprocessor, I am using the rollup-plugin-svelte. 🌮

Q: This isn't working exactly as specified.

A: I'm sure it isn't! It's highly tailored for my environment. Let me know what's wrong and how to fix it. Open an issue and I'll see what I can do.