Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Fuse is a command line tool to fuse multiple JavaScript or HTML files into one. If you're fusing JavaScript you can optionally compress or mangle the JavaScript code.
Fuse is a simple cli tool to combine multiple JavaScript or HTML files into one. It also makes use of UglifyJS2 to either compress, or mangle or do both to the output of the JavaScript. It's designed to be simple, do less and be easy to use.
[sudo] npm install fuse -g
You need to install it globally, because it's not something that you can require
in your nodejs code. It's only a command line program.
npm test
Tests are run using Mocha. You can also run make test
to run the tests.
Fuse uses inline comment-based directives to determine which files you'd like to fuse. You can use @depends
, @import
or @include
as the directive.
Use the following syntax in your main JavaScript file to inform Fuse about which JavaScript files you'd like to fuse and where.
// @depends path/to/javascript/file.js
Passing a file with the line above to Fuse, will produce a file containing the original JavaScript and the content of path/to/javascript/file.js in the exact position of the fuse directive.
Fuse uses HTML comment-based directives to determine which HTML files you'd like to fuse. Use the following syntax in your main HTML file to inform Fuse about which HTML files you'd like to fuse and where.
<!-- @depends path/to/html/file.html -->
Passing a file with the line above to Fuse, will produce a file containing the original HTML and the content of path/to/html/file.html in the exact position of the fuse directive.
To run just once and combine JavaScript:
fuse -i path/to/main.js -o path/to/output.js
To watch a file for changes and combine HTML:
fuse -i path/to/main.html -o path/to/main-combined.html -w
When watching, Fuse will automatically watch any referenced files for changes too, and recompile the output file upon any changes to reference files. Fuse will also rescan the input file for new reference files, or referenced files that have been removed and either watch or unwatch those respectively.
To compress the output using UglifyJS2 (JavaScript only):
fuse -i path/to/main.js -o path/to/output.js -c
To mangle the output using UglifyJS2 (JavaScript only):
fuse -i path/to/main.js -o path/to/output.js -m
To compress and mangle, and watch (JavaScript only):
fuse -i path/to/main.js -o path/to/output.js -c -m -w
To lint with jshint before combining (JavaScript only):
fuse -i path/to/main.js -o path/to/output.js -l
FAQs
The magical GraphQL framework
The npm package fuse receives a total of 4,456 weekly downloads. As such, fuse popularity was classified as popular.
We found that fuse demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.