Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
express-less-middleware
Advanced tools
This middleware is designed to compile LESS on the fly.
npm install --save express-less-middleware
Should only be used for development. LESS should be compiled during a build process
next()
)
lessMiddleware( options )
options
./public
(string)String
or Object
String
- will be path to express public directory.*Object
- less parser options
options.publicDir
- same value as if options
were a string. Same default valueoptions.paths
** paths should be relative to cwd. path.join
is used with process.cwd()
as first argument when processing all paths
const http = require("http");
const express = require("express");
const app = express();
// this assumes that the publicly available folder is on the same directory level
// as the file that starts your express server
const lessCompiler = require("express-less-middleware")();
// if that's not the case, initialize it with the path to your public/client-side folder
// the path should be relative to the directory where the file that starts your express server is
// Example below.
//
// const lessCompiler = require( 'express-less-middleware' );
// lessCompiler = lessCompiler( '../path/to/public/folder' );
// OR
// const lessCompiler = require( 'express-less-middleware' );
// lessCompiler = lessCompiler({ publicDir: '../path/to/public/folder', ... });
// ....everything else that has to do with configuring
// you should only use this when developing. Not meant for production
if (process.env.NODE_ENV === "dev") {
// this must be "used" before express.use( express.static() ) or it will not work (no next())
app.use(lessCompiler);
}
// ....other stuff relative to your express app
http.createServer(app).listen(8000);
MIT
FAQs
Compiles LESS on a per request basis in Express
The npm package express-less-middleware receives a total of 10 weekly downloads. As such, express-less-middleware popularity was classified as not popular.
We found that express-less-middleware 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.