
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
html, javascript and css optimization. Build on top of r.js and using clean-css and html compressor.
The library will parse a folder (containing your html, javascript and css) to generate a folder containing the optimized content:
r.js is using a build file which I slightly extended.
Even if AMD module are really great, you do not need to use AMD modules, r.js is using uglifyjs and can minify your javascript regardless.
You will need npm and node.js to install and run the hone.js.
sudo npm -g install hone.js
hone create my-app
cd my-app
hone build
You can also create a more complex example (with AMD modules) this way:
hone create my-app -t example
cd my-app
hone build
If you don't want to compress the html:
hone build --skiphtml
If you don't want to minify the css:
hone build --skipcss
See the help:
hone -h
See the version:
hone -v
- my-app --> root
|-- app --> contain your application: html, css, js, and so on
|-- build/build.json --> describe the content to optimize the application
|-- public --> generated on the first build from the app folder, contains the optimized files
The build.json file is an extension of the build used by r.js. The property minCss has been added to list the css to minify, here is a simple example:
{
"appDir": "../app",
"baseUrl": "./",
"dir": "../public",
"minCss": [
"styles/styles-home.css"
]
}
And here is a more complex example with AMD modules:
{
"appDir": "../app",
"baseUrl": "./",
"dir": "../public",
"minCss": [
"styles/styles-home.css",
"styles/styles-page.css"
],
"paths": {
"text": "js/libs/text",
"jquery": "js/libs/jquery-1.7.2.min",
"module1": "modules/module1",
"module2": "modules/module2"
},
"modules": [
{
"name": "js/app"
},
{
"name": "js/app-page"
}
]
}
More info there:
You can use @import in css files to concatenate css files:
@import url('./shared.css');
body {
background: #F7ECDC;
}
Clean-css is used to minify the css. The css files to minify can be listed in the build.json, see example above.
HTML compressor is used to compressed the html:
FAQs
HTML, js, css optimization
We found that hone.js 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.