Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
function-arguments
Advanced tools
Changelog
Readme
Get arguments of a function, useful for and used in dependency injectors. Works for regular functions, generator functions and arrow functions.
Install with npm
$ npm i function-arguments --save
Important: for more advanced stuff please use parse-function, don't suggest features or complex bugs.
For more use-cases see the tests
const functionArguments = require('function-arguments')
Get function arguments names.
Params
fn
{Function}: Function from which to get arguments names.returns
{Array}Example
var fnArgs = require('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' ]
As it works for ES2015, it also works if you use comments in weird places.
console.log(fnArgs(function /* something may */ (
// go,
go,
/* wrong, */
here
// (when, using, comments) {}
) { return 1 })) // => [ 'go', 'here' ]
arguments
object or list of… more | homepage.arguments
and the last argument… more | homepagePull 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.
FAQs
Get arguments of a function, useful for and used in dependency injectors. Works for regular functions, generator functions and arrow functions.
The npm package function-arguments receives a total of 9,187 weekly downloads. As such, function-arguments popularity was classified as popular.
We found that function-arguments demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.