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

async-proxy

v0.4.1

Published

Create asynchronous nesting proxy in Node.js and browser

Readme

async-proxy npm GitHub license Build Status Coverage Status

Create asynchronous nesting proxy in Node.js and browser.

Installation

npm install --save async-proxy
# or
yarn add async-proxy
import createAsyncProxy from 'async-proxy'

Usage

Just modify handlers to suit your project.

Default handler(get, set, remove methods come from object-path-operator module):

{
  async get(target, path) {
    return get(target, path)
  }
, async apply(target, path, caller, args) {
    return Reflect.apply(get(target, path), caller, args)
  }
, async set(target, path, value) {
    set(target, path, value) // The return value will be ignored
  }
, async deleteProperty(target, path) {
    remove(target, path) // The return value will be ignored
  }
, async construct(target, path, args) {
    return Reflect.construct(get(target, path), args)
  }
, async setPrototypeOf(target, path, prototype) {
    return Reflect.setPrototypeOf(get(target, path), prototype) // The return value will be ignored
  }
, async getPrototypeOf(target, path) {
    return Reflect.getPrototypeOf(get(target, path))
  }
, async defineProperty(target, path, prop, descriptor) {
    return Reflect.defineProperty(get(target, path), prop, descriptor) // The return value will be ignored
  }
}

Example

create

const localBaseObj = {}

const proxy = createAsyncProxy(localBaseObj, {})

get

;(async () => {
  await proxy.something.asynchronous.property
})()

apply

;(async () => {
  // handled by apply handler
  await proxy.something.asynchronous.method(some, args)

  // handled by get handler
  ;(await proxy.something.asynchronous.method)(some, args)
})()

set

;(async () => {
  // The return value is not reliable, ou should check the results by other means to ensure that the operation is successful.
  // Non-blocking when it is an asynchronous operation, so your asynchronous operation should have an inside sequence queue.
  proxy.something.asynchronous.property = 'something'
})()

delete

;(async () => {
  // The return value is not reliable, ou should check the results by other means to ensure that the operation is successful.
  // Non-blocking when it is an asynchronous operation, so your asynchronous operation should have an inside sequence queue.
  delete proxy.something.asynchronous.property
})()

new

;(async () => {
  // handled by construct handler
  await new proxy.something.asynchronous.construct()

  // handled by get handler
  new (await proxy.something.construct)()
})()

for await

;(async () => {
  for await (const prop of await proxy.something.enumerable) {
    ...
  }
})()

setPrototypeOf

;(async () => {
  // The return value is not reliable, ou should check the results by other means to ensure that the operation is successful.
  // Non-blocking when it is an asynchronous operation, so your asynchronous operation should have an inside sequence queue.
  Object.setPrototypeOf(proxy.something.asynchronous.something, Array.prototype)
})

getPrototypeOf

;(async () => {
  // handled by getPrototypeOf handler
  await Object.getPrototypeOf(proxy.something.asynchronous.property)

  // handled by get handler
  Object.getPrototypeOf(await proxy.something.asynchronous.property)
})()

defineProperty

;(async () => {
  // The return value is not reliable, ou should check the results by other means to ensure that the operation is successful.
  // Non-blocking when it is an asynchronous operation, so your asynchronous operation should have an inside sequence queue.
  Object.defineProperty(proxy.something.asynchronous, 'property', {
    value: 'something'
  })
})()

API

Table of Contents

createAsyncProxy

Create a Proxy to asynchronous operate object.

Parameters

Returns Proxy Async Proxy