
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@jesscss/plugin-node-modules
Advanced tools
Jess plugin for resolving and loading npm packages from node_modules.
This plugin provides npm/node_modules resolution and loading capabilities for all Jess language plugins. It uses Node's module resolution algorithm (require.resolve) to find and load npm packages.
import { Compiler } from '@jesscss/jess';
import nodeModulesPlugin from '@jesscss/plugin-node-modules';
const compiler = new Compiler({
compile: {
plugins: [
nodeModulesPlugin(),
// ... other plugins
]
}
});
resolvePackage(packageName: string): string | nullResolve an npm package name to its absolute path.
const plugin = new NodeModulesPlugin();
const path = plugin.resolvePackage('less-plugin-clean-css');
// Returns: '/path/to/node_modules/less-plugin-clean-css/index.js' or null
loadPackage(packageName: string): Promise<Record<string, any> | null>Load an npm package module.
const plugin = new NodeModulesPlugin();
const module = await plugin.loadPackage('less-plugin-clean-css');
// Returns: the module exports, or null if not found
tryResolvePackages(packageNames: string[]): Promise<{ name: string; module: Record<string, any> } | null>Try to resolve a package name with multiple possible names. Returns the first successfully resolved package.
const plugin = new NodeModulesPlugin();
const result = await plugin.tryResolvePackages([
'clean-css',
'less-plugin-clean-css'
]);
// Returns: { name: 'less-plugin-clean-css', module: {...} } or null
Other plugins (like @jesscss/plugin-less-compat) can use this plugin to resolve npm packages:
// In jess-plugin-less-compat
const nodeModulesPlugin = plugins.find(p => p.name === 'node-modules');
if (nodeModulesPlugin instanceof NodeModulesPlugin) {
const module = await nodeModulesPlugin.loadPackage('less-plugin-clean-css');
}
enabled (boolean, default: true): Whether to enable auto-resolution of npm packages.FAQs
Jess plugin for resolving and loading npm packages from node_modules
The npm package @jesscss/plugin-node-modules receives a total of 755 weekly downloads. As such, @jesscss/plugin-node-modules popularity was classified as not popular.
We found that @jesscss/plugin-node-modules demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.