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 🙏

© 2024 – Pkg Stats / Ryan Hefner

freemarker-visualizer

v0.2.1

Published

A command-line utility to produce visualize graphs of FreeMarker dependencies.

Downloads

10

Readme

freemarker-visualizer

Version Downloads/week License

Introduction

A command-line utility to produce visual graphs of FreeMarker file trees. It was inspired by Madge, a library that produces visual graphs of JavaScript dependencies.

  • Files specified in <#import /> and <#include /> directives are graphed by default
  • Plugins can be used to add additional information to the graph

Setup

npm install -g freemarker-visualizer

Install graphviz:

# OS X:
brew install graphviz || port install graphviz
# Fedora:
dnf install graphviz
# Ubuntu:
apt-get install graphviz

Usage

Graph file tree:

freemarker-visualizer path/to/template.ftl --directories path/to/dir

This will display a visual graph.

Save graph as an image:

freemarker-visualizer path/to/template.ftl --directories path/to/dir --image graph.svg

This will save graph.svg in the cwd.

Specify multiple template directories:

freemarker-visualizer path/to/template.ftl --directories dir1 dir2

This is useful in a project that has multiple base template directories. To avoid difficulty using freemarker-visualizer, the directories may be set in a configuration file.

Add additional template info:

freemarker-visualizer path/to/template.ftl --directories path/to/dir --plugins path/to/plugin.js

This will generate a graph with additional information about each processed template.

Configuration

Property | Type | Default | Description --- | --- | --- | --- directories | Array | null | paths of base directories to search for templates plugins | Array | null | paths to plugins template | String | null | path to template image | String | graph.png | path for generated graph image

You can add a configuration file in .config/freemarker-visualizer/config.js in your home directory or provide it through the --config flag.

Writing plugins

To generate additional information about each template, a plugin can be referenced through the cli or added to the configuration file.

Each plugin must:

  • be a JavaScript file
  • export a function with a data parameter
  • return an object with the new information to be displayed

See example plugins for more information.

Limitations

Currently, this utility will ignore template paths that are not relative to one of the provided base template directories. For example, "*/template.ftl" would not be resolved.