# fn-name [](https://travis-ci.org/sindresorhus/fn-name) > Get the name of a named function There is a [`name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name) property on functions, but it's not supported in all browsers. This module tries that property then falls back to extracting the name from the function source. ## Install ``` $ npm install fn-name ``` ## Usage ```js const fnName = require('fn-name'); fnName(function foo() {}); //=> 'foo' ``` ---