Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
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.
as a command line tool
npm install gluex -g
as a module
npm install gluex --save
GLUEX uses inline comment-based directives to determine which files you'd like to glue.
// @gluex path/to/file.js
or
/* @gluex path/to/file.js */
<!-- @gluex path/to/file.html -->
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.
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);
<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:
gluex -i path/to/input.xx -o path/to/output.xx -n production
gluex('path/to/input.xx', 'path/to/output.xx', 'production');
<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.
MIT License
Copyright (c) 2017 Stefan Keim (indus)
FAQs
a tool to glue all of your stuff together
The npm package gluex receives a total of 3 weekly downloads. As such, gluex popularity was classified as not popular.
We found that gluex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.