Socket
Socket
Sign inDemoInstall

es5-shim

Package Overview
Dependencies
Maintainers
0
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es5-shim

ES5 as implementable on previous engines


Version published
Weekly downloads
1.5M
increased by6.12%
Maintainers
0
Weekly downloads
 
Created

What is es5-shim?

The es5-shim package is a JavaScript library that provides compatibility shims so that legacy JavaScript engines behave as closely as possible to ECMAScript 5 (ES5). This is particularly useful for supporting older browsers that do not implement all ES5 features natively.

What are es5-shim's main functionalities?

Array methods

Provides ES5 array methods like map, filter, and reduce which might not be available in older JavaScript engines.

[1, 2, 3].map(function(n) { return n + 1; })

Function.prototype.bind

Implements Function.prototype.bind, allowing functions to have their this value and initial arguments pre-set.

var boundFunc = function(a, b) { return a + b; }.bind(null, 1); boundFunc(2);

Object methods

Adds missing Object methods such as keys, which returns an array of a given object's own enumerable property names.

Object.keys({a: 1, b: 2})

String methods

Includes String.prototype methods like trim, which removes whitespace from both ends of a string.

'hello'.trim()

Date methods

Provides shims for Date methods like now, which returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.

Date.now()

Other packages similar to es5-shim

FAQs

Package last updated on 27 Jan 2011

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