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

metalsmith-groff

v0.4.2

Published

A Metalsmith plugin to call the groff document formatting system on files

Readme

metalsmith-groff

This plugin for Metalsmith is aimed at generating documents written for groff. It has very few Javascript dependencies, but expects groff to be correctly installed on the system.

NPM version

Usage

If using the CLI for Metalsmith, metalsmith-groff can be used like any other plugin by including it in metalsmith.json.

{
  "plugins": {
    "metalsmith-groff": {}
  }
}

In Metalscript's JavaScript API, metalsmith-groff can be used like any other plugin by attaching it to the function invocation chain on the Metalscript object.

const groff = require('metalsmith-groff')

require('metalsmith')(__dirname)
  .use(groff())
  .build()

If metalsmith-groff is used as above without any argument, it will handle any file ending with .ms, .me, .mm or .mom and call groff with the eponymous macro to build a PDF document. The original file is dropped and replaced by the produced PDF one. To extend this default behaviour, it is possible to provide options as a simple objet.

Options

Here are the options handled by the plugin. A good share of them is used to configure the call to groff, so reading groff manual will provide additional and useful information.

  • device is the groff output device to be used. Default is pdf, and other common devices provided with groff are html or ps.

  • encoding sets the input encoding. It is the -K option of groff and defaults to utf8.

  • macroPackages is an array of macros to use. By default, the plugin tries to choose a classical macro package using the file extension.

  • macroPaths is an array of additional paths to search for macros. The default value is empty, see man groff_tmac for further explanation about the search sequence.

  • preprocessors is an array of preprocessors to be used by groff. Common preprocessors are tbl, pic or soelim. It is empty by default.

  • pattern is the matcher used to determine the files to be transformed. It is used with minimatch. The default value (**/*.@(me|mm|ms|mom)) matches all files ending with .ms, .me, .mm or .mom at any depth.

  • The source file is dropped if source is false (the default behaviour), but remains in the tree along the translated document if true.