https://github.com/gorenje/node-red-contrib-uglifyjs
Uglify javascript code using a node
https://github.com/gorenje/node-red-contrib-uglifyjs
node-red nodes uglifyjs
Last synced: 3 months ago
JSON representation
Uglify javascript code using a node
- Host: GitHub
- URL: https://github.com/gorenje/node-red-contrib-uglifyjs
- Owner: gorenje
- License: other
- Created: 2023-10-13T13:11:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-14T16:32:08.000Z (about 2 years ago)
- Last Synced: 2026-01-12T02:37:36.607Z (5 months ago)
- Topics: node-red, nodes, uglifyjs
- Language: HTML
- Homepage:
- Size: 34.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node-RED node wrapping Uglify-JS
Simple node that using the uglify-js package to minify Javascript code.
The node calls `minify` passing the options defined in the nodes configuration.
All this nodes does is:
```
var UglifyJS = require("uglify-js");
const uggCfg = RED.util.evaluateNodeProperty(cfg.config, cfg.configType, node, msg)
msg.payload = UglifyJS.minify(msg.payload, uggCfg);
send(msg)
```
Configuration provided in the nodes property panel is passed directly to the Uglify-JS `minify` method.
One could say this is a wrapper node around the uglify-js package and one would be quite correct.
The [usage example](https://flowhub.org/f/ca78ac1011bd3194) is also included in the package, Node-RED --> Import --> Examples:

### Artifacts
- [Flow maintaining this code](https://flowhub.org/f/1cb1d34936a3b179)
- [GitHub repo](https://github.com/gorenje/node-red-contrib-uglifyjs)
- [NPMjs package](https://www.npmjs.com/package/@gregoriusrippenstein/node-red-contrib-uglifyjs)
- [Node-RED package page](https://flows.nodered.org/node/@gregoriusrippenstein/node-red-contrib-uglifyjs)