Skip to content

timoxley/namefn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

namefn

Create a new, equivalent function with the specified name.

The original function's properties, arity and prototype are maintained with the newly named function.

var nameFn = require('namefn')

function User() {

}

console.log(new User()) // User {}

var OtherUser = nameFn('OtherUser', User)

console.log(new OtherUser()) // OtherUser {}

See Also

License

MIT

About

Rename a function.

Resources

License

Stars

Watchers

Forks

Packages

No packages published