1 # mimic-fn [![Build Status](https://travis-ci.org/sindresorhus/mimic-fn.svg?branch=master)](https://travis-ci.org/sindresorhus/mimic-fn)
3 > Make a function mimic another one
5 Useful when you wrap a function in another function and like to preserve the original name and other properties.
11 $ npm install mimic-fn
18 const mimicFn = require('mimic-fn');
27 console.log(wrapper.name);
30 mimicFn(wrapper, foo);
32 console.log(wrapper.name);
35 console.log(wrapper.unicorn);
42 It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set.
46 Modifies the `to` function and returns it.
63 - [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function
64 - [keep-func-props](https://github.com/ehmicky/keep-func-props) - Wrap a function without changing its name, length and other properties
69 MIT © [Sindre Sorhus](https://sindresorhus.com)