npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

default-proxy-handler

v1.0.2

Published

A template for creating npm packages using TypeScript and VSCode

Readme

default-proxy-handler

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly Semantic Release

Interfaces

Variables

DefaultProxyHandler

Const DefaultProxyHandler: <T>() => DefaultProxyHandler<T>

Type declaration

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']);
Type parameters

| Name | Type | | :------ | :------ | | T | extends object |

Returns

DefaultProxyHandler<T>

Defined in

index.ts:68

index.ts:77

Interfaces

Interface: DefaultProxyHandler<T>

Type parameters

| Name | Type | | :------ | :------ | | T | extends object |

Hierarchy

  • ProxyHandler<T>

    DefaultProxyHandler

Methods

apply

apply(target, thisArg, argArray): any

Parameters

| Name | Type | | :------ | :------ | | target | T | | thisArg | any | | argArray | any[] |

Returns

any

Overrides

ProxyHandler.apply

Defined in

index.ts:78


construct

construct(target, argArray, newTarget): object

Parameters

| Name | Type | | :------ | :------ | | target | T | | argArray | any[] | | newTarget | Function |

Returns

object

Overrides

ProxyHandler.construct

Defined in

index.ts:80


defineProperty

defineProperty(target, property, attributes): boolean

Parameters

| Name | Type | | :------ | :------ | | target | T | | property | string | symbol | | attributes | PropertyDescriptor |

Returns

boolean

Overrides

ProxyHandler.defineProperty

Defined in

index.ts:82


deleteProperty

deleteProperty(target, p): boolean

Parameters

| Name | Type | | :------ | :------ | | target | T | | p | string | symbol |

Returns

boolean

Overrides

ProxyHandler.deleteProperty

Defined in

index.ts:88


get

get(target, p, receiver): any

Parameters

| Name | Type | | :------ | :------ | | target | T | | p | string | symbol | | receiver | any |

Returns

any

Overrides

ProxyHandler.get

Defined in

index.ts:90


getOwnPropertyDescriptor

getOwnPropertyDescriptor(target, p): undefined | PropertyDescriptor

Parameters

| Name | Type | | :------ | :------ | | target | T | | p | string | symbol |

Returns

undefined | PropertyDescriptor

Overrides

ProxyHandler.getOwnPropertyDescriptor

Defined in

index.ts:92


getPrototypeOf

getPrototypeOf(target): null | object

Parameters

| Name | Type | | :------ | :------ | | target | T |

Returns

null | object

Overrides

ProxyHandler.getPrototypeOf

Defined in

index.ts:97


has

has(target, p): boolean

Parameters

| Name | Type | | :------ | :------ | | target | T | | p | string | symbol |

Returns

boolean

Overrides

ProxyHandler.has

Defined in

index.ts:99


isExtensible

isExtensible(target): boolean

Parameters

| Name | Type | | :------ | :------ | | target | T |

Returns

boolean

Overrides

ProxyHandler.isExtensible

Defined in

index.ts:101


ownKeys

ownKeys(target): ArrayLike<string | symbol>

Parameters

| Name | Type | | :------ | :------ | | target | T |

Returns

ArrayLike<string | symbol>

Overrides

ProxyHandler.ownKeys

Defined in

index.ts:103


preventExtensions

preventExtensions(target): boolean

Parameters

| Name | Type | | :------ | :------ | | target | T |

Returns

boolean

Overrides

ProxyHandler.preventExtensions

Defined in

index.ts:105


set

set(target, p, newValue, receiver): boolean

Parameters

| Name | Type | | :------ | :------ | | target | T | | p | string | symbol | | newValue | any | | receiver | any |

Returns

boolean

Overrides

ProxyHandler.set

Defined in

index.ts:107


setPrototypeOf

setPrototypeOf(target, v): boolean

Parameters

| Name | Type | | :------ | :------ | | target | T | | v | null | object |

Returns

boolean

Overrides

ProxyHandler.setPrototypeOf

Defined in

index.ts:109