![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
babel-middleware-stzhang
Advanced tools
Express/Connect middleware to pre-process requested JS files through Babel
Simple Express/Connect middleware to automatically transpile JavaScript files from ES2015+ to ES5 via Babel, and cache the results to memory or the file-system as desired.
var express = require('express');
var babel = require('babel-middleware-stzhang');
var app = express();
app.use('/js/', babel({
srcPath: 'app/js',
cachePath: __dirname + '/_cache'
babelOptions: {
presets: ['es2015']
}
}));
app.listen(3001);
srcPath: '/path/to/js/'
An absolute or relative path to the input source. This option is required.
cachePath: '/path/to/cache/'|'memory'
Use either memory for an in-memory cache; or a path to the desired cache directory (it does not need to exist when the app starts).
Default: memory
exclude: ['production/example/*.js']
An array of path globs to exclude from transpiling and caching. Returns the originally requested file. See Micromatch documentation for globbing examples. Exclusions do not match against srcPath
.
Default: []
babelOptions: {}
An options object passed into babel.transformFile
. See Babel documentation for usage.
debug: true|false
Print debug output.
Default: false
Apache 2.0.
FAQs
Express/Connect middleware to pre-process requested JS files through Babel
We found that babel-middleware-stzhang 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.