
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).
esm-loader-import-alias
Advanced tools
Node.js ESModule Loader for rewriting import path aliases.
Warning! Using experimental Node.js features and flags, API will likely change. This may be helpful for development and testing, but should not be used in production.
Some frameworks will allow aliases in import paths ($lib
). This loader helps
Node.js handle these aliases:
import { tool } from '$lib/utils.js'
This loader can be configured, and chained with other loaders, using node-esm-loader.
npm install --save-dev esm-loader-import-alias node-esm-loader
// .loaderrc.js
import { resolve } from 'node:path'
export default {
loaders: [
{
loader: 'esm-loader-import-alias',
options: {
aliases: {
// SvelteKit $lib import path alias example
'$lib/': `${resolve('src/lib/')}/`,
},
},
},
],
}
// index.js
import Component from '$lib/Component.js'
# node >= 20.7
NODE_OPTIONS="--import node-esm-loader/register" node index.js
# node < 20.7
NODE_OPTIONS="--loader node-esm-loader" node index.js
See example above.
// .loaderrc.js
export default {
loaders: [
{
loader: 'esm-loader-import-alias',
options: {
debug: true,
},
},
],
}
In your loader chain:
FAQs
Chainable ESModule Loader for import path aliases
The npm package esm-loader-import-alias receives a total of 38 weekly downloads. As such, esm-loader-import-alias popularity was classified as not popular.
We found that esm-loader-import-alias 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.