Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-es2pi

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-es2pi

ES6 + a little more on top of ES5

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

build status

es2pi.js

ES6 + a little more on top of ES5

Description

In short, es2pi is a collection of ES6 polyfills + methods missing even in ES6.

Why reinvent the wheel?

Because:

  • shims/polyfills found to date are not quite optimal, especially Map and Set.
  • If you want just Map/Set, see https://github.com/dankogai/js-es6-map
  • ES6 is rather inconsistent in the choice of methods, like...
  • Adding String.prototype.repeat while Array.prototype.repeat is missing. You should be able to go like var a = [0].repeat(42);
  • Type.isType is available only for Array.
  • typeof null === null is welcome but shouldn't we add Object.typeOf, too?
  • and the .typeOf() methods like 'JavaScript'.typeOf() === 'string' ?
  • and look, num.is(42) is definitely better than Object.is(num, 42) !

Thanks to ES5, it is now safe to extend Object.prototype via Object.defineProperty yet we are still too afraid. Underscore.js is a great hack but a hack nontheless. Isn't it time to stop wrapping JavaScript's bad parts and extend its good parts?

What is es2pi named after?

2π is a little bigger than 6, isn't it?

Table of Contents

See Also

Keywords

FAQs

Package last updated on 02 Apr 2013

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