0.0.1 • Published 3 years ago

qliproxy v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

QliProxy

Designed to help you work with JS Proxy with ease.

Warning

This project is in the early stages of development! Please feel free to make a pull request :)

Getting Started

  1. To begin using QliProxy, make sure you have it installed
npm install qliproxy
  1. Next, import the submodule QliProxy using the appropriate syntax for your environment

CommonJS:

const {QliProxy} = require('qliproxy')

ES6:

import {QliProxy} from 'qliproxy'
  1. Begin using the proxy
import {QliProxy} from 'qliproxy'

const myProxyObject = new QliProxy({
	get: ()=>12 // Our proxy will now return 12 for every property, no matter what the actual value is
})

To learn how to utilize your proxy object please see the section below

Proxy Options

optiondescriptioninput
getintercepts properties being accessedcallback function
setintercepts properties being modifiedcallback function
deleteintercepts properties being deletedcallback function
objectallows you to provide a base object to initialize your proxyobject or function
getKeysintercepts and provides the keys when they're enumeratedcallback function
readallows you to enable/disable the reading of propertiesboolean
writeallows you to enable/disable the modification of propertiesboolean
hasintercepts calls to hasOwnProperty and the in operatorcallback function
constructintercepts constructor calls (applicable to classes only)callback function
executeintercepts function execution (applicable to functions only)callback function