npm.io
1.0.2 • Published 8 years ago

es-arguments

Licence
ISC
Version
1.0.2
Deps
1
Vulns
0
Weekly
0
Stars
15

ES Arguments

Travis Build Codecov npm downloads

Description

Get the argument names of any es method.

Usage

npm install es-arguments

const getArguments = require('es-arguments')

getArguments(function (arg1, arg2) {}) // ['arg1', 'arg2']
getArguments(function (arg1=1, arg2=2) {}) // ['arg1', 'arg2']
getArguments(function ({ arg1, arg2 }) {}) // ['{ arg1, arg2 }']
getArguments(function (args = { arg1, arg2 }) {}) // ['args']
getArguments((arg1, arg2) => {}) // ['arg1', 'arg2']

Keywords