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

mingler

v1.0.4

Published

Sprockets inspired JavaScript concatenater

Downloads

15

Readme

Mingler

Mingler is an easy-to-use easy-to-install concatenation tool which syntax is inspired by Sprockets and Juicer. Mingler doesn't try to be anything else than what it is: A tool for concatenating (merging) and minifying files. This makes it ideal to include in your project's build-tools, Jakefile, etc. The package comes with a handy commandline tool which can be used globally.

Installation

Installation of Mingler is easy - It's an NPM package: npm install mingler -g

Remember to install globally (the -g flag), else the commandline tool wont be available to you.

Programmatical Usage

Mingler was originally made for use in code, such as Jakefiles or custom build systems. It builds on an internal event structure which gives complete control over the concatenation of minification process.

var mingler = require('mingler');

// The 'complete' callback, will be called when concatenation
// (and minification) is complete.
mingler.on('complete', function(concatenation) {
  console.log("Concatenation complete:", concatenation);
});

// The 'warning' callback will be called when a warning occures.
// This could for example be a missing file.
mingler.on('warning', function(warn) {
  console.warn(warn);
});

// When an error is thrown, the 'error' callback is called.
// It's important to handle this callback because the mingling doesn't
// automatically stop
mingler.on('error', function(error) {
  console.error(error);
});

// The 'concatenate' event is fired before a new file is concatenated.
// The argument 'feedback' has a property called filename, and a method
// called 'discard()'. The discard method will prevent the file from being
// merged into the 'master' file.
mingler.on('concatenate', function(feedback) {
  if(feedback.filename == 'something_ugly') {
    feedback.discard();
  } else {
    console.log("Wee concatenation of " + feedback.filename + " has begun");
  }
});

// index.js is for example a file which includes a lot of other files
// that is needed for the project.
mingler.mingle("index.js");

Issues

All issues with this package is encouraged to be reported as GitHub Issues here in the repository. I'll try to fix the bug or implement the feature suggestion as fast as possible.