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 🙏

© 2025 – Pkg Stats / Ryan Hefner

gluex

v0.1.7

Published

a tool to glue all of your stuff together

Downloads

64

Readme

gluex

glue your stuff together

GLUEX is a tool to glue multiple HTML, JavaScript or JSON files (or other file types) together. It lets you use selectors to only pick a certain tag from a HTML document or a certain property from a JSON. Furthermore it allows the usage of namespaces, for example to distinguish between a development and a productive scenario. It could be used as a CLI tool as well as a module in your code.

Installation

as a command line tool

npm install gluex -g

as a module

npm install gluex --save

Usage

GLUEX uses inline comment-based directives to determine which files you'd like to glue.

In a JavaScript file

// @gluex path/to/file.js

or

/* @gluex path/to/file.js */

In a HTML file

<!-- @gluex path/to/file.html -->

invoke as a CLI tool

to glue just once:

gluex -i path/to/input.xx -o path/to/output.xx

to watch files for changes:

gluex -i path/to/input.xx -o path/to/output.xx -w

When watching, GLUEX will automatically watch any referenced files for changes too, and recompile the output file upon any changes to reference files.

invoke as a module

var gluex = require("gluex"),

inputPath = "path/to/input.xx",
outputPath = "path/to/output.xx",
namespace = null,
watch = true,

gluex(inputPath, outputPath, namespace, watch);

if you omit the outputPath the glued file gets returned by the function like so...

var output = gluex(inputPath);

Advanced Usage

Namespaces

<body>
<!-- gluex path/to/dev_only.html -->
<!-- gluex:production path/to/prod.html -->
</body>

When calling gluex with the namespace production the first directive will be replaced with an empty string (deleted) and only the second one will be replaced with the content of the refernced file. Calling with no namespace will replace both comments and remove none. This works the same for JS. You can pass a namespace like so:

CLI

gluex -i path/to/input.xx -o path/to/output.xx -n production

Module

gluex('path/to/input.xx', 'path/to/output.xx', 'production');

Selectors

<head>
    <title><!-- gluex path/to/package.json (.name) --></title>
</head>
<body>
<!-- gluex path/to/partials.html (#someID) -->
</body>

For JSON and HTML includes you can put a selectors behind the filename (in brackets). For a JSON file the selector has to be a property path. For a HTML file you can use any CSS selector.

License

MIT License

Copyright (c) 2017 Stefan Keim (indus)