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

minundy.js

v1.1.1

Published

Minimal Underscore Template Build System -> min und -> minundy.js. Manages pre-building JS/HTML templates using underscore.js

Downloads

15

Readme

Install with Yarn

Works with yarn, npm and probably* any other known build system in 2018/2019

yarn add --flat minundy.js

* Unknown and unlisted build systems are Untested

minundy.js

The current version is 1.0.3

minimal underscore.js templates build tool. Minimal Underscore Template Build System.

Transforms HTML templates, written for underscore.js template library, into JavaScript functions, compiled with _.template('str',{variable:'data'}) and writes to a single JavaScript object, output as JSON to filetemplates.js

Dependencies

Minimal dependencies. Primarily, underscore.js, which has the template engine. The second dependency is the Command Line Utility commanderjs. colorlogjs, which powers logging.

Works With

Works with yarn, built for yarn.

Works with The command line. Perfect for static HTML sites, servers without the ability to run nodejs as well as any place implementing underscore templates.

requires: underscore.js, node v10

Innerworking Details

Much like other configurable build systems, this script concatenates files together. To improve speed, this script keeps an intermediary step folder, processing HTML to JS into a js-dist-separate folder then watching this intermediary folder for changes, via fs.watch, for combining into templates.js. As of version 1.0.1 minundy.js uses a temporary system folder for this step unless explicitly specified, such as --distro-separate <location/path/here>

Usage, Single, Simple Watch and Build

	node node_modules/minundy.js/src/minundy.js watch --infolder path/html/to/watch  --distro path/dist/folder

Usage, Set intermediary folder location

If you experience an error regarding distro-separate (or just have a preference), you can use a known path by supplying --distro-separate <location> on the command line.

node node_modules/minundy.js/src/minundy.js watch --infolder path/html/to/watch  --distro path/dist/folder --distro-separate path/dist/single/file 

Usage, Build Only

node minundy.js just-build --w path/html/to/watch  --distro path/dist/folder --distro-separate path/dist/single/file 

Usage, Multiple Watch

# combine files from multiple roots into single templates.js
# WARN: this COULD overwrite files. Unique across folders isn't managed

node node_modules/minundy.js/src/minundy.js watch  --root /User/absolute/path --infolder path/files/a --infolder path/files/b --infolder path/files/c --distro-separate path/single/files/built --distro path/js-distro

Usage, Relative from Current Working Directy (CWD)

	node node_modules/minundy.js/src/minundy.js watch --infolder path/files/templates_v1 --infolder path/files/templates_v2 --infolder path/files/templates_v3 --distro some-dist/path/files/templates

Debug

Add the --debug <Number> flag to emit logging statments. Set --debug 5 to get all messages, including console.debug

Features

  • Common root with --root <location> flag
  • ---distro-separate is a temporary system folder as default configuration. Eases setup burden
  • Action specific commands watch & just-build
  • Builds only deltas during watch. Improves build speed.
  • --silent flag
  • Debugging flag --debug is a numerical level, which provide greater granularity
  • Relative to CWD at execution time, not script location
  • Renamed --watch to --infolder
  • Automatic absolute path checking and preservation --distro /var/app/location --infolder some/relative/location
  • logging verbosity support via colorlogjs

Distrubtion via yarn, npm and Github

	yarn add --flat minundy.js
	npm install minundy.js
yarn add --flat https://github.com/gtzilla/minundy.js

Target Specific Commit or Release in Github

Target release 1.0.1, which is commit cf972ab89bac3f69fb29a01648055db64ef2a29d

yarn add --flat https://github.com/gtzilla/minundy.js/archive/cf972ab89bac3f69fb29a01648055db64ef2a29d.tar.gz
Tips on Usage

Add a scripts section to your package.json. I prefer yarn watch for monitoring HTML / JS during development. Replace below PATHs with your own paths.

"scripts":{
	"watch":"node node_modules/minundy.js/src/minundy.js watch --debug 6 --infolder server_path/to_static/js-view-templates/ 
	--distro server_path/to_static-dist/js-view-templates/"
}

By default, I provoke the most verbose response with --debug 6, but if I need less screen output, I can always yarn watch --silent to suppress all logging.