Socket
Socket
Sign inDemoInstall

get-function-arguments

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-function-arguments

Get function arguments, useful for and used in dependency injectors. Works for regular functions, generator functions and arrow functions.


Version published
Maintainers
1
Created
Source

get-function-arguments npmjs.com The MIT License

Get function arguments, useful for and used in dependency injectors. Works for regular functions, generator functions and arrow functions.

code climate standard code style travis build status coverage status dependency status

Install

npm i get-function-arguments --save

Usage

For more use-cases see the tests

const getFunctionArguments = require('get-function-arguments')

getFunctionArguments

Get function arguments names.

Params

  • fn {Function}: Function from which to get arguments names.
  • max {Number}: How many characters to cut from fns toString.
  • returns {Array}

Example

var fnArgs = require('get-function-arguments')

console.log(fnArgs(function (a, b, c) {})) // => [ 'a', 'b', 'c' ]
console.log(fnArgs(function named (a , b, c) {})) // => [ 'a', 'b', 'c' ]

console.log(fnArgs(a => {})) // => [ 'a' ]
console.log(fnArgs((a, b) => {})) // => [ 'a', 'b' ]

console.log(fnArgs(function * (a ,b, c) {})) // => [ 'a', 'b', 'c' ]
console.log(fnArgs(function * named (a ,b, c) {})) // => [ 'a', 'b', 'c' ]

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckoCore.tk keybase tunnckoCore tunnckoCore npm tunnckoCore twitter tunnckoCore github

Keywords

FAQs

Package last updated on 18 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc