
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).
@types/resolve
Advanced tools
TypeScript definitions for resolve
The @types/resolve package provides TypeScript type definitions for the 'resolve' package. This allows TypeScript developers to use the 'resolve' package, which is a utility for resolving file paths within projects, with type safety. It helps in ensuring that the usage of 'resolve' adheres to the expected types of its API, making the development process more robust and error-free.
Resolving a module path
This feature allows you to synchronously resolve the path of a module relative to a base directory. It is useful for finding the location of a module within a project.
import * as resolve from 'resolve';
resolve.sync('module_name', { basedir: process.cwd() });
Asynchronous module path resolution
This demonstrates how to asynchronously resolve the path of a module. It provides a callback-based approach to handle the result or error, making it suitable for non-blocking operations.
import * as resolve from 'resolve';
resolve('module_name', { basedir: process.cwd() }, (err, res) => {
if (err) console.error(err);
else console.log(res);
});
The 'resolve' package itself is what @types/resolve provides types for. It is a utility for resolving file paths, especially useful in complex projects where modules can be nested in various directories.
While not a direct alternative, @types/node provides TypeScript definitions for Node.js core modules, including path resolution functionalities. It's broader in scope compared to @types/resolve but includes types for resolving modules using Node.js built-in methods.
npm install --save @types/resolve
This package contains type definitions for resolve (https://github.com/browserify/resolve).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/resolve.
These definitions were written by Mario Nebl, Klaus Meinhardt, and Jordan Harband.
FAQs
TypeScript definitions for resolve
The npm package @types/resolve receives a total of 9,534,707 weekly downloads. As such, @types/resolve popularity was classified as popular.
We found that @types/resolve 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.