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

variety-plugin-latex

v0.0.3

Published

Variety plugin, outputs results of Variety analysis in Latex format.

Downloads

9

Readme

Variety plugin - Latex output

This plugin outputs results of Variety analysis in Latex format.

\documentclass{article}
\begin{document}
    \begin{center}
         \begin{tabular}{|c|c|c|c|} \hline
            key & types & occurrences & percents \\ \hline
            \_id & ObjectId & 5 & 100.0 \\ \hline
            name & String & 5 & 100.0 \\ \hline
            bio & String & 3 & 60.0 \\ \hline
            birthday & String & 2 & 40.0 \\ \hline
            pets & Array,String & 2 & 40.0 \\ \hline
            someBinData & BinData-old & 1 & 20.0 \\ \hline
            someWeirdLegacyKey & String & 1 & 20.0 \\ \hline
        \end{tabular}
    \end{center}
\end{document}

How to run plugin

First download the index.js file from this Github repository.

wget https://raw.githubusercontent.com/todvora/variety-plugin-latex/master/index.js

Then pass the plugin path in Variety parameters like this:

mongo test --eval "var collection = 'users'; var plugins='/path/to/plugin/index.js';" variety.js

If you downloaded the plugin inside the same directory, where the is located also variety.js, you can omit the path and call Variety like this:

mongo test --eval "var collection = 'users'; var plugins='index.js';" variety.js

Number of columns

By default all the data columns are printed. If you are interested only in first N columns, adjust the plugin configuration:

mongo test --eval "var collection = 'users'; var plugins='index.js|numColumns=2';" variety.js

This will output only the first two columns (name, types).

Hacking

If you want to hack on this plugin, just fork this repository and change index.js content.

Please see also the test suite. You can run the tests from your browser or console (with node.js). The tests are writen in Jasmine framework.

Console runner

You have to install node / npm first. Then you should install the test dependencies:

npm install -g jasmine-node jshint

Now you can run the test suite by calling

npm test

Browser tests

If you don't want or can't run console tests, you can use the included HTML test runner. Open in your browser tests.html located inside this repository. You should see the current results of tests. To repeat execution just reload the page.

Inspiration / idea

The latex output idea and first implementation comes from @joggino. Please see Variety pull request #91 for additional info.