
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@es-shims/api
Advanced tools
For any given “es-shim API v3”-compliant package foo, the following invariants must hold:
node/io.js, all versions of all ES3-compliant browsers or later, Web Workers, and node-webkit. Other environments are a plus, but not expected.require('foo') is a spec-compliant JS or native function. However, if the function’s behavior depends on a receiver (a “this” value), then the first argument to this function will be used as that receiver. The package should indicate if this is the case in its README.Promise.all that depend on their receiver without a fallback, the index must ensure that receiverless invocation acts as if the static method was called on its original object, but must also allow .call/.bind/.apply to alter the receiver when relevant.require('foo/implementation') is a spec-compliant JS function, that will depend on a receiver (a “this” value) as the spec requires.require('foo/polyfill') is a function that when invoked, will return the most compliant and performant function that it can - if a native version is available, and does not violate the spec, then the native function will be returned - otherwise, either the implementation, or a custom, wrapped version of the native function, will be returned. This is also the result that will be used as the default export.require('foo/shim') is a function that when invoked, will call getPolyfill, and if the polyfill doesn’t match the built-in value, will install it into the global environment.require('foo/auto') will automatically invoke the shim method.shim method.npm test must run the package’s tests.required.require('foo'); delete Function.prototype.call; must not alter the behavior of foo.var callBound = require('call-bound'); var slice = callBound('Array.prototype.slice'); slice([1], 1); — this technique works in ES3 environments, and will ensure that modifying Array.prototype or Function.prototype will not interfere with the package.If your package contains multiple shims, you can pass --multi to apply these invariants:
shim and auto entrypoints that match the same invariants described above. The shim entry point must invoke the shim entry point in each of the subdirectories listed in the main exportimplementation entry point.Prominently in the package’s README, please include the following markdown:
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://www.ecma-international.org/ecma-262/6.0/).
Please modify “ES3” as needed to the level of support, and please update the spec link so it points directly to the most relevant section of the spec it complies with.
Very simple and shallow tests that a package follows the es-shim API.
Pass --bound to indicate that the function the package is implementing depends on having a receiver (a “this” value). In particular, this applies to something that is a prototype method, or a static method that depends on its receiver.
es-shim-api object-assign
es-shim-api array-includes --bound
Simply clone the repo, npm install, and run npm test
FAQs
Loosely test a package's compliance with the es-shim API
The npm package @es-shims/api receives a total of 6,057 weekly downloads. As such, @es-shims/api popularity was classified as popular.
We found that @es-shims/api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.