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

tikz.js

v0.0.3

Published

Enables the creation of standalone graphics based on PGF/TikZ with the help of LaTeX and ImageMagick.

Readme

tikz.js

tikz.js enables the creation of standalone graphics based on PGF/TikZ with the help of LaTeX and ImageMagick. It provides a simple command line tool that handles creation, conversion, and generation of high-quality images using the LaTeX based PGF library with the TikZ API.

Requirements

The application is a simple Node.js script that comes with a set of dependencies. All dependencies are resolved and locally installed when running npm install tikz.js. It is recommended to install the application globally, i.e., npm install tikz.js -g. This will setup a command called tikz.

Besides Node.js and npm some external applications may or may not be required.

  • LaTeX with packages such as pgf, pgfplots, or others. The basic template can be changed / selected, which may change the required packages. Besides LaTeX itself there is no hard dependency here. Also the application for the compilation itself (e.g., pdflatex) can be changed.
  • ImageMagick for eventual conversion from PDF to PNG files (or similar). If you are satisfied with PDF (or EPS) output, then you'll be fine.

There are no more external dependencies.

Running the Application

In the ideal case the application is invoked via the tikz command. A local installation can also be run with ./tikz.js or node tikz.js. There are some command line requirements. At least one argument (input file) has to be supplied.

tikz source.tikz

Please note that the extension tikz is just a convention and does not have to be used. You could also name your files foo.tex. In the end an output file is generated. You can also change the name of the output file, e.g.,

tikz source.tikz target.pdf

If you want to generate a PNG from the TikZ source you can also use the PNG mode:

tikz source.tikz target.png -m png

The mode is independent from the file name.

API for Build Integration

Besides the obvious way of using the CLI for triggering the compilation process, the project also comes with a very small API. Actually, the CLI only wraps the API.

var conversion = tikz({
  input: 'drawing.tikz',
  mode: 'png',
});

conversion.on('done', function (output) {
  console.log('File %s produced!', output);
});

conversion.start();

There are many more options and events. The most important ones are all used in the CLI wrapper. Currently, the only exposed function is start. It starts the transformation process(es).

Why ?

A good answer would be "Why not?". In my opinion TikZ is one of the best applications to use programming for drawing high-quality graphics, e.g., for publication. Unfortunately, TikZ is only available as a TeX package. This drawback, however, is also one of the best reasons to prefer using TikZ over other (TeX-decoupled) solutions. It means that the best available typesetting capabilities can be used.

I wanted a solution that uses the best parts of TeX (thus requiring / depending on TeX), while giving me a simple command line utility ready for compiling small dedicated files. The tool should be simple enough to be used in any kind of build system (possibly as a pre- or post-process).

Why did I choose Node.js and not Bash, Python, ...? In my opinion the key differentiator lies in the NPM eco-system. Yes, Python has PIP (or other solutions), but there are a few convenience utilities that render working with NPM / Node.js joyful. Besides, I am relying on a bunch of handy modules that have already been released.

So long answer short: I need a tool that can be invoked from the command line (or via some API) that wires together some other program invocations to produce a graphics output from a file only containing valid TikZ code. In the best case others will find this tool useful as well.

License

The MIT License (MIT)

Copyright (c) 2015 Florian Rappl

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.