npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

extendscript-es5-shim

v0.3.1

Published

a collection of useful es5-shims for Extendscript

Downloads

670

Readme

extendscript-es5-shim

All Contributors

A collection of ES5 shims for polyfiling Exendscript (for es6 shims take a look at https://github.com/ExtendScript/extendscript-es6-shim)

Installation

npm init -y
npm install extendscript-es5-shim

Usage

Array, String and Function notes

All polyfills could be used in your code.

Object notes

Because it is impossible to emulate property descriptors in ES3 engine, the following functions are just a mocks and you should avoid to use them in your code if it is possible, only shim thirdparty libraries:

defineProperty, defineProperties

Supports only data descriptor. Writable, enumerable and configurable properties of descriptor are ignored. If you try to define set or get propperty this methods will throw an error.

getOwnPropertyDescriptor

Supports only data descriptor. Configurable property of descriptor is always TRUE. Enumerable and writable properties of descriptor will be always TRUE on user defined objects, but may vary on build in.

freeze, preventExtensions, seal

Only validate input parameter and return input if it is an object.

isExtensible, isFrozen, isSealed

Validates input and returns TRUE, FALSE, FALSE, respectively if input parametr is an object.

These functions you can use in your code:

create

Support of property descriptor is in the same level as in defineProperty. Although, you can use this function in your code like this:

var obj1 = {a : 1};
var obj2 = Object.create(obj1, {b : {value : 2}});

or like that:

var obj1 = {a : 1};
var obj2 = Object.create(obj1);
obj2.b = 2;

getOwnPropertyNames

This function uses reflection interface, that ExtendScript provides (see JavaScript Tools Guide), to get own properties of an object (enumerable or not). But ther is no guarantee that the order of enumeration will be the same as in for in loop.

keys

Use for in loop along with hasOwnProperty function to get own enumerable properties in object.

getPrototypeOf

Use build in __proto__ property as return value.

Development

  • Install the devDependencies by running npm install
  • Bundle the index.js by running npm run bundle
  • Add new prototypes in the respective folders
  • If you need new folders, add the folder to the top of ./bin/concat.js into the folders array

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!