Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
The es5-ext package is a collection of ECMAScript 5 extensions. It provides polyfills for some of the newer ECMAScript features, as well as additional utility functions that enhance the JavaScript standard library.
Array polyfills and extensions
Adds new methods to the Array prototype, such as 'contains', which checks if an array includes a certain element.
[1, 2, 3].contains(2)
Object polyfills and extensions
Introduces new functions to work with objects, like 'isObject', which determines if a value is an object.
Object.isObject({})
String polyfills and extensions
Provides additional methods for strings, for instance, 'startsWith', which checks if a string starts with the specified characters.
'hello'.startsWith('he')
Function polyfills and extensions
Enhances functions with extra capabilities such as 'noop', which is an empty function that does nothing.
(function () {}).noop()
Number polyfills and extensions
Offers new properties and methods for numbers, like 'isFinite', which checks if a value is a finite number.
Number.isFinite(Infinity)
Core-js is a modular standard library for JavaScript, which includes polyfills for ECMAScript up to 2021. It's more comprehensive than es5-ext, covering a wider range of ECMAScript features.
Lodash is a utility library that provides a lot of the same functionality as es5-ext, such as working with arrays, objects, and functions. It is known for its performance and consistency across browsers.
Underscore.js is a utility library that offers similar functionality to es5-ext, with a focus on functional programming. It's often compared to lodash, and while it has many of the same functions, it has a smaller footprint.
Useful functions and objects that are not part of the standard.
It's work in progress, new methods are added when needed.
Can be used in any environment that implements ES5.
In implementations that are stuck to ES3 it will work when shim (e.g. es5-shim) is introduced.
To use it with node:
$ npm install es5-ext
Recommended way:
var curry = require('es5-ext/lib/Function/curry');
curry(...);
or less specific:
var fnExt = require('es5-ext/lib/Function');
fnExt.curry(...);
fnExt.sequence(...);
if you want to take them all:
var ext = require('es5-ext');
ext.Function.curry(...);
ext.Function.sequence(...);
ext.Object.merge(...);
For descriptions look into source files.
global
reserved
Array.slice(obj[, begin[, end]])
Array.toArray(obj)
Many of the following are inspired by http://osteele.com/sources/javascript/functional/
Function.K(obj)
Function.S(f, g)
Function.bindMethods(obj[, scope])
Function.call(f)
Function.curry(f[, ...])
Function.flip(f)
Function.invoke(methodName[, ...])
Function.isFunction(x)
Function.sequence(f[, ...])
Object.elevate(obj[, res])
Object.get(obj)
Object.isObject(x)
Object.isPlainObject(x)
Object.link(obja, objb)
Object.merge(target, source)
Object.set(obj)
Object.setTrue(obj)
Object.setValue(obj, value)
Object.values(obj)
When using node & npm
$ npm test
FAQs
ECMAScript extensions and shims
The npm package es5-ext receives a total of 8,024,792 weekly downloads. As such, es5-ext popularity was classified as popular.
We found that es5-ext 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.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.