• Stars
    star
    609
  • Rank 73,614 (Top 2 %)
  • Language
    JavaScript
  • Created over 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

For learning how to use JavaScript Proxy, or just to see what is possible

proxy-fun

🐐 For learning how to use JavaScript Proxy, or just to see what is possible through metaprogramming in modern JavaScript. Tries to collect resources such as presentations, articles, modules and examples using Proxy, Reflect and other intercession type metaprogramming.

The Proxy object was included in the ES2015 iteration of the standard and is available in all evergreen browsers and Node.js v6. Unfortunately as it is a big language semantic change, it cannot be polyfilled through transpilers such as Babel.

Know of any brilliant resources? Let us know and we'll create a vast collection of awesomeness.

JavaScript ES2015 Proxy

Proxies are a common pattern in both programming and networking. It often entails something interfacing with something else. Usually a proxy takes the role of the original contstruct and intercepts calls made to that construct and in some cases altering it's original behaviour. This allows you to enrich functions with more actions or operations in a transitive manner, or even intercept and cancel an action.

A proxy can be looked at as a decorator function, but with you can intercept default language semantics also, in a meta-level of programming instead of at the base-level.

TL;DR? See an overview of examples using JavaScript Proxy in the summary.

Proxy Resources

Presentations

Videos

Articles

Modules

  • slice: Slice implements Python's extended slice syntax and negative indexing in JavaScript using proxies.
  • zer: Zer helps you serialize any JavaScript chains to String representations of any languages by leveraging ES2015 Proxy objects
  • negative-array: Negative array index support array[-1] using ES2015 Proxy
  • tpyo: A small script that enables you to make typos in JavaScript property names. Powered by ES6 proxies + Levenshtein string distance.
  • stevia: Experimental module providing natural sweetening for javascript objects
  • known: Allow only access to known object properties using ES2015 Proxy
  • iSeries: A set of modules that use Proxy to extend and enhance your existing JavaScript classes.
  • proxy-observe: A Proxy based implementation of Object.observe
  • Experimental Safe JavaScript Navigation : The purpose of this function is to provide a way to avoid deep nested conditionals when traversing a hierarchy of objects
  • allora: Promisify everything in less tha ~50 lines It can be used to use promises on any javascript object.
  • stroxy: A simple streaming wrapper for native event functions (e.g. addEventListener) using ES2015 proxies.
  • Declaraoids: Declarative programming on steroids.
  • python-range: A JavaScript implementation of the Python's range() function.
  • rebridge: Transparent Javascript-Redis bridge.
  • box-js: A tool for studying JavaScript malware.
  • v: Secure, Synchronized, Realtime, Cloud, Native JavaScript Variables & Events.
  • Promiser: Promise combination resolver by get accessor pattern.
  • React Easy State: A transparent state management library for React.
  • The Observer Utility: A general purpose transparent reactivity library (React Easy State is just a thin wrapper of it). It uses ES6 Proxies to achieve a 100% language coverage for reactivity.
  • The Compiler Utility: A 'sandboxed' code evaluation library. It uses ES6 Proxies (has traps) in conjuction with the with keyword to 'sandbox' code.
  • Did I do that?: A debug tool based on JavaScript Proxy to track surprising/unwanted mutation of objects.
  • mewt: Array and object immutability implemented in under one kilobyte using Proxies.
  • objecthistory: Object undo, redo & change history using Proxies.
  • hoopy: Circular array type
  • emmis: Chaining API where you reduce over payload and operators, like redux
  • rus_roulette: Bringing runtime errors back to fashion
  • Echo: Write a line of code that starts with Echo, and Echo will print it back to the console.
  • Comlink: Uses proxies to hide the fact that you're using Web Workers.
  • enum-xyz: JavaScript enums using proxies.

Meta-programming in general

Resources not using JavaScript Proxy, but shows different usages of creative and awesome meta-programming to be used as inspiration.

Articles

Modules

  • jsPipe: Implementing pipes in Javascript using pseudo operator overloading.
  • JSDecorators: Python like decorators in Javascript with pseudo operator overloading.

Examples in this repo

Run all examples in this repo by using node@6:

$ node ./examples/<example-file>.js

Examples using tracing and tests can be run using npm:

$ npm test

Remember to install all example dependencies by doing npm i

More Repositories

1

node-notifier

A Node.js module for sending notifications on native Mac, Windows and Linux (or Growl as fallback)
JavaScript
5,742
star
2

gulp-notify

gulp plugin to send messages based on Vinyl Files or Errors to Mac OS X, Linux or Windows using the node-notifier module. Fallbacks to Growl or simply logging
JavaScript
592
star
3

marked-terminal

A Renderer for the marked project. Allowing you to render Markdown to print to your Terminal
JavaScript
423
star
4

mversion

A cross packaging module version bumper. CLI or API for bumping versions of package.json, bower.json, *.jquery.json etc.
JavaScript
199
star
5

node-notifier-cli

CLI API for node-notifier as separate package.
JavaScript
143
star
6

SocialFeed.js

Generate a social feed in javascript.
JavaScript
132
star
7

metatune

PHP Wrapper for the Spotify Metadata API and the Spotify Play Button
PHP
55
star
8

node-osascript

A stream for Apple Open Scripting Architecture (OSA) through AppleScript or Javascript
JavaScript
50
star
9

bacon-love

A Nodeschool type workshop for Functional Reactive Programming and Bacon.js
JavaScript
48
star
10

fp-react

Functional tools for React components
JavaScript
41
star
11

vscodemod

VSCode extension for doing codemod on selected text
JavaScript
30
star
12

did-i-do-that

A debug tool based on JavaScript Proxy to track surprising/unwanted mutation of objects.
JavaScript
26
star
13

gulp-gitmodified

A plugin for Gulp to get an object stream of modified files on git.
JavaScript
22
star
14

frp-piano

An example of Functional Reactive Programming, by implementing a simple collaborative piano.
CSS
19
star
15

babel-plugin-transform-react-require

Transform files using JSX to implicitly require React (or other implementations).
JavaScript
15
star
16

node-heartrate

A Bluethooth Low Energy heart rate stream
JavaScript
15
star
17

gulp-gitshasuffix

A plugin for Gulp to suffix files with latest commit sha.
JavaScript
11
star
18

chrome-github-packages

Enhance Package.json on Github by linking up modules to NPM
JavaScript
11
star
19

mrun

mrun - A npm module for setting npm run properties to build/watch less and browserify code
JavaScript
10
star
20

lastfm-spotify-urilist

A Node.js module for an easy way of getting a list of Spotify URIs based on Last.fm data.
JavaScript
10
star
21

markdowner

Markdowner is a cloud based application for writing and sharing Markdown documents.
JavaScript
9
star
22

cli-usage

Easily show the usage of your CLI tool from a Markdown string or file
JavaScript
9
star
23

AI-Poker-Player

NTNU Project for AI Programming
Python
8
star
24

metabrag

A jQuery plugin for showing off your GitHub and Coderwall stats.
JavaScript
7
star
25

kodesnutt

Kode brukt i episoder av Kodesnutt.io
JavaScript
5
star
26

simplify-playbutton

Automated service for generating Spotify Play Button for your Last.fm scrobbled tracks. Using Node.js and running on Heroku.
JavaScript
5
star
27

kakle

If Commit, Then Do. Kakle helps you remember when you should run commands after pulling external changes
JavaScript
5
star
28

clapper

Do actions on applause and listen on claps on browser usermedia
JavaScript
4
star
29

node-csstats

Parse AMX Mod X Stats File. A result of procrastinating during a Master's thesis and nostalgia.
JavaScript
4
star
30

SwarmWebots

Project 4 - Artificial Swarm Behavior
Python
4
star
31

traceur-cli

Wraps traceur cli to add REPL and string eval
JavaScript
4
star
32

record-access

Property accessors as functions similar to .property in elm-lang.
JavaScript
4
star
33

didt

Did I do that?
JavaScript
3
star
34

json-ast

OCaml JSON AST generator. Work in progress
OCaml
3
star
35

phpcoderwall

PHP library for fetching Coderwall data
PHP
3
star
36

presentations

A collection of presentations
JavaScript
3
star
37

bacon.decorate

Unify your API and abstract time using Functional Reactive Programming and Bacon.js
JavaScript
3
star
38

graphql-node-import

Import `.graphql` and `.gql` files directly in Node, accessing queries and fragments
TypeScript
3
star
39

rm-debugger

Simplest codemod you can think of, but is still handy: Remove all `debugger;` statements from your code.
JavaScript
2
star
40

nextjs-css-relative-assets-bug-repro

JavaScript
2
star
41

diy-nextjs-server-actions

Example code from presentation "DIY Nextjs Server Actions"
TypeScript
2
star
42

standalone-unrar

A standalone unrar library without any need for external dependencies.
JavaScript
2
star
43

AnnWebots

Project 3 - Webots with Generic Anns
Python
2
star
44

node-repo-github

A very simple node.js wrapper to get Github Repo Information.
JavaScript
2
star
45

twit-stream

Streaming Twitter data with proper Node.JS streams2 with a simple API
JavaScript
2
star
46

react-formdata

A library for generating an object of values from a set of inputs in React
JavaScript
2
star
47

twitscraper

A binary used for scraping the Twitter site for tweets and generate a .tsv file for output
JavaScript
2
star
48

mikaelbr

My special repository
2
star
49

release-actions-demo

JavaScript
1
star
50

bekk-open-source

Repo brukt for planlegging av faggruppearbeid ifm. Open Source
1
star
51

metaenter

A simple jQuery plugin for simulating a facebook-like text input.
JavaScript
1
star
52

dotfiles

My dotfiles used for importing to new systems and backup
Shell
1
star
53

Basic-Evolutionary-Programming

The code for a University project
Python
1
star
54

simplserv

A simple HTTP server using Python. For web development and testing AJAX calls.
Python
1
star
55

aoc22

Advent of Code solutions for 2022 in OCaml
OCaml
1
star
56

lsystem-reasonml

ReasonML experimentation implementing Lindenmayer system
OCaml
1
star
57

stringywingy

Check if a sentence or a word is an anagram or a palindrome.
JavaScript
1
star
58

tweetsa

Python
1
star
59

webkom-kurs2015

Kurs for Webkom Kickoff 2015.
JavaScript
1
star
60

tdcinfographic-raspberry

Server component to the tdcinfographic application. Connecting to the tdcinfographic Node.js app through WebSockets.
Python
1
star
61

podcast-player

CLI tool for listening to podcasts.
JavaScript
1
star
62

kodesnutt.io

Kodesnutt.io homepage
HTML
1
star
63

asyncjs.kodesnutt.io-source

Source for asyncjs.kodesnutt.io
CSS
1
star
64

async-kodesnutt

CSS
1
star
65

webkom-kurs2015-webpack

Kurs for Webkom Kickoff 2015 - WebPack versjon
JavaScript
1
star
66

gifme

gifme client for posting gifs to Slack
OCaml
1
star
67

ndc

My talk for NDC2014: Functional Reactive Programming and Bacon
JavaScript
1
star
68

simplify-zones

Simplify geometry of tariff zones from Entur
JavaScript
1
star
69

tweetannotator

A web tool for annotating sentiment on random tweets. Can be used to generate data sets for machine learning algorithms
JavaScript
1
star
70

CP-Sudoku

Constraint based sudoku solver
Java
1
star
71

immutable-memo

Memoization with immutable data structures for React.memo
JavaScript
1
star
72

textareaAutoHeight

Create a Facebook like input box in seconds. A text area will automaticly set height according to content, and submit on enter, but give new line at shift + enter.
JavaScript
1
star
73

auto-unrar

Automatic unpack all recursive rar-files from a directory
JavaScript
1
star
74

azure-ml-text-analysis

API Wrapper for doing text analysis on Azure Machine Learning Platform
JavaScript
1
star
75

cheerful.dev

Test site for Svelte, Sapper and Now.sh
Svelte
1
star
76

Coding-Dojo-Counter

A web application for selecting sparrers and keeping time in Coding Dojos. Integration with Facebook Events
JavaScript
1
star
77

bekk-trhfrontend-prosjektoppsett

Oppsett av nye frontendprosjekter med transpilering og LESS. Stegvis guide til hvordan det kan gjøres.
JavaScript
1
star