Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 8, 2024 via pnpm

function.prototype.name 1.1.6

An ES2015 spec-compliant `Function.prototype.name` shim
Package summary
Share
0
issues
1
license
65
MIT
Package created
27 Feb 2016
Version published
28 Aug 2023
Maintainers
1
Total deps
65
Direct deps
4
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
65 Packages, Including:
array-buffer-byte-length@1.0.1
arraybuffer.prototype.slice@1.0.3
available-typed-arrays@1.0.7
call-bind@1.0.7
data-view-buffer@1.0.1
data-view-byte-length@1.0.1
data-view-byte-offset@1.0.0
define-data-property@1.1.4
define-properties@1.2.1
es-abstract@1.23.3
es-define-property@1.0.0
es-errors@1.3.0
es-object-atoms@1.0.0
es-set-tostringtag@2.0.3
es-to-primitive@1.2.1
for-each@0.3.3
function-bind@1.1.2
function.prototype.name@1.1.6
functions-have-names@1.2.3
get-intrinsic@1.2.4
get-symbol-description@1.0.2
globalthis@1.0.4
gopd@1.0.1
has-bigints@1.0.2
has-property-descriptors@1.0.2
has-proto@1.0.3
has-symbols@1.0.3
has-tostringtag@1.0.2
hasown@2.0.2
internal-slot@1.0.7
is-array-buffer@3.0.4
is-bigint@1.0.4
is-boolean-object@1.1.2
is-callable@1.2.7
is-data-view@1.0.1
is-date-object@1.0.5
is-negative-zero@2.0.3
is-number-object@1.0.7
is-regex@1.1.4
is-shared-array-buffer@1.0.3
is-string@1.0.7
is-symbol@1.0.4
is-typed-array@1.1.13
is-weakref@1.0.2
isarray@2.0.5
object-inspect@1.13.1
object-keys@1.1.1
object.assign@4.1.5
possible-typed-array-names@1.0.0
regexp.prototype.flags@1.5.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
ⓘ This is a list of function.prototype.name 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
call-bind1.0.721.6 kBMIT
prod
define-properties1.2.15.08 kBMIT
prod
es-abstract1.23.31 BMIT
prod
functions-have-names1.2.35.86 kBMIT
prod

Visualizations

Frequently Asked Questions

What does function.prototype.name do?

Function.prototype.name is an ES2015 spec-compliant shim that adds functionality to the existing JavaScript Function.prototype object. It aims to fill in gaps in JavaScript environments that might not natively support the function name property by providing a polyfill. This property typically returns the name of the function, as a string value. Remember, for this shim to work, your environment must support ES5, specifically ES5 getters.

How do you use function.prototype.name?

When it comes to implementation, first, you need to install the "function.prototype.name" package using npm, which can be done using the command npm install function.prototype.name. Then you can require it in your JavaScript file like so:

var functionName = require('function.prototype.name');
var assert = require('assert');

Next, you can use it standalone or you can invoke the "shim" method if Function.prototype.name is unavailable in your environment. For example:

assert.equal(functionName(function foo() {}), 'foo');
functionName.shim();
assert.equal(function foo() {}.name, 'foo');

In the above example, the ‘functionName’ function is used to get the name of a function (in this case, 'foo'). Then, the shim method is called to patch lack of native support for Function.prototype.name.

Where are the function.prototype.name docs?

The documentation for function.prototype.name is included in the README file on the package's GitHub repository. The URL for the repository is git://github.com/es-shims/Function.prototype.name.git. Other relevant information about the API, including the spec it complies with, can be found at https://www.ecma-international.org/ecma-262/6.0/#sec-get-regexp.prototype.flags. Moreover, the package complies with the es-shim API interface, documented at https://github.com/es-shims/api.