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.
@craigcollie/webpack-express-handler
Advanced tools
### Overview This package aims to consolidate your development and production environments for handling static files and serving your `index.html`.
This package aims to consolidate your development and production
environments for handling static files and serving your index.html
.
This means that your npm start
script is used in both development, and
production - and a single configuration can be used for both. This speeds up both
development and testing time since your environments should be roughly identical.
Installing the package into your project by running:
$ yarn add @craigcollie/webpack-express-handler
This will install the core package, along with it's dependencies which require very little configuration. The dependencies will include:
When creating your new express
app, the webpack-express-handler
will return your newly wrapped app with middleware
applied, to cater for static file handling in both production and development environments.
const express = require('express');
const webpackExpressHandler = require('@craigcollie/webpack-express-handler');
const webpackConfig = require('./your/webpack/config');
const isProd = process.env.NODE_ENV === 'production';
const app = webpackExpressHandler(express(), isProd, webpackConfig);
app.get('/', (req, res) => {
// Your index.html is cached internally
// on the first request only
res.send(app.locals.html);
});
app.listen(3000);
As an example of how you might configure your server, the following could be
added to your package.json
.
{
"scripts": {
"start:dev": "node ./src/server.js",
"start:prod": "NODE_ENV=production node ./src/server.js"
}
}
FAQs
### Overview This package aims to consolidate your development and production environments for handling static files and serving your `index.html`.
The npm package @craigcollie/webpack-express-handler receives a total of 13 weekly downloads. As such, @craigcollie/webpack-express-handler popularity was classified as not popular.
We found that @craigcollie/webpack-express-handler 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.