Skip to content

s4y/argment.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

argment

…a tiny library whose end goal is to make argument-sniffing code like this obsolete, by providing an easy way to declare what arguments a function expects.

How you use it

argment is brand new! For the moment, it augments any function to take an options hash, and expands it into nice, old-fashioned arguments. Like this:

function foo(a, b, c){
	console.log(a, b, c);
}
foo = argment(['a', 'b', 'c'], foo);

foo({ a: 'one', c: 'three' });

Just call argment with a function and an array describing the arguments it takes.

About

Easy named arguments for JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published