let o = {}
o.quack = (x)=> "quack ! "
//Monkey patching ! My console is now a Duck !
console.quack = (x)=> "quack ! "
let b = {
quack: (x)=> "quack ! "
}
console.log(b.quack())
// Duck typing :
// if it looks like a duck (i.e has a function called quack())
// if it quacks like a duck
// then it's a duck
// therefore I can call it like a duck
f = (duck)=>console.log(duck.quack())
f(b)
f(o)
f(console)
// It doesn't look like a duck
f({ })
// It doesn't quack like a duck
f({ quack:"foo"})
Cleanup, Speedup, Levelup.
One package at a time.
e18e (Ecosystem Performance) is an initiative to connect the folks and projects working to improve the performance of JS packages.
We'd also like to provide visibility to the efforts of countless open source developers working to cleanup, levelup, and speedup our dependencies.
We invite you to get involved in the different projects linked from these pages, and to connect with other like-minded folks.
As part of the community e18e effort, this project provides a collection of module replacements (i.e. possible alternative packages).
We provide two things:
Manifests (mappings of modules to their possible replacements)
Documentation for more complex replacements
List of JavaScript methods which you can use natively + ESLint Plugin