0.1.1 • Published 8 years ago
get-function-header v0.1.1
get-function-header

Zero-dependency get function header
Installation
yarn add get-function-headerUsage
import getFunctionHeader from 'get-function-header'
async function sayHello(who, ...messages) {
console.log(`${ who }: ${ messages.join() }`)
}
getFunctionHeader(sayHello.toString()).trim()
// async function sayHello(who, ...messages)API
Table of Contents
getFunctionHeader
Get function header codeing from function string.
Parameters
codestring The function string get from Function.prototype.toStringwithCommentsboolean Return header with comments or not (optional, defaultfalse)
Returns string The function header string