
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
default-proxy-handler
Advanced tools
A template for creating npm packages using TypeScript and VSCode
• Const DefaultProxyHandler: <T>() => DefaultProxyHandler<T>
• new DefaultProxyHandler<T>(): DefaultProxyHandler<T>
A class of proxy handler that forward all properties and methods to the original target.
DefaultProxyHandler can be used as the super class for creating a more
sophisticated proxy handler.
Example
A proxy whose handler is an DefaultProxyHandler should have the same
properties as the original object.
import { DefaultProxyHandler } from 'default-proxy-handler';
const helloWorld = { hello: 'world' };
const helloWorldProxy = new Proxy(helloWorld, new DefaultProxyHandler());
expect(helloWorldProxy.hello).toBe(helloWorld.hello);
Example
You can extend DefaultProxyHandler to change the behavior of the proxy.
import { DefaultProxyHandler } from 'default-proxy-handler';
class RepeatedProxyHandler extends DefaultProxyHandler<{ hello: string }> {
override get(target: { hello: string; }, p: string | symbol, receiver: any) {
const originalValue: unknown =
super.get(target, p, receiver);
return [ originalValue, originalValue ];
}
}
const helloWorld = { hello: 'world' };
const helloWorldProxy = new Proxy(helloWorld, new RepeatedProxyHandler());
expect(helloWorldProxy.hello).toEqual(['world', 'world']);
| Name | Type |
|---|---|
T | extends object |
| Name | Type |
|---|---|
T | extends object |
ProxyHandler<T>
↳ DefaultProxyHandler
▸ apply(target, thisArg, argArray): any
| Name | Type |
|---|---|
target | T |
thisArg | any |
argArray | any[] |
any
ProxyHandler.apply
▸ construct(target, argArray, newTarget): object
| Name | Type |
|---|---|
target | T |
argArray | any[] |
newTarget | Function |
object
ProxyHandler.construct
▸ defineProperty(target, property, attributes): boolean
| Name | Type |
|---|---|
target | T |
property | string | symbol |
attributes | PropertyDescriptor |
boolean
ProxyHandler.defineProperty
▸ deleteProperty(target, p): boolean
| Name | Type |
|---|---|
target | T |
p | string | symbol |
boolean
ProxyHandler.deleteProperty
▸ get(target, p, receiver): any
| Name | Type |
|---|---|
target | T |
p | string | symbol |
receiver | any |
any
ProxyHandler.get
▸ getOwnPropertyDescriptor(target, p): undefined | PropertyDescriptor
| Name | Type |
|---|---|
target | T |
p | string | symbol |
undefined | PropertyDescriptor
ProxyHandler.getOwnPropertyDescriptor
▸ getPrototypeOf(target): null | object
| Name | Type |
|---|---|
target | T |
null | object
ProxyHandler.getPrototypeOf
▸ has(target, p): boolean
| Name | Type |
|---|---|
target | T |
p | string | symbol |
boolean
ProxyHandler.has
▸ isExtensible(target): boolean
| Name | Type |
|---|---|
target | T |
boolean
ProxyHandler.isExtensible
▸ ownKeys(target): ArrayLike<string | symbol>
| Name | Type |
|---|---|
target | T |
ArrayLike<string | symbol>
ProxyHandler.ownKeys
▸ preventExtensions(target): boolean
| Name | Type |
|---|---|
target | T |
boolean
ProxyHandler.preventExtensions
▸ set(target, p, newValue, receiver): boolean
| Name | Type |
|---|---|
target | T |
p | string | symbol |
newValue | any |
receiver | any |
boolean
ProxyHandler.set
▸ setPrototypeOf(target, v): boolean
| Name | Type |
|---|---|
target | T |
v | null | object |
boolean
ProxyHandler.setPrototypeOf
FAQs
A template for creating npm packages using TypeScript and VSCode
We found that default-proxy-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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.