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

extendscriptkit

v0.1.7

Published

ExtendScript shims and helpers

Downloads

5

Readme

ExtendScriptKit

Shims and helpers for ExtendScript, adds some methods to built-in prototypes. Mostly for AE at the moment and can only be used in combination with Browserify.

See modern-extendscript as an example.

Installing

npm install --save-dev extendscriptkit

If you don't want to use Browserify, you can download the zip of this repository and use the ExtendScriptKit.jsx bundle

Features

Help me add more =)

AE Helpers

  • Application.prototype.
    • undoable(nameOfAction, func) - Easy undo
    • faster(func) - Creates a temporary new composition for when doing a lot of updates. (around 2x speed increase)
  • Project.prototype.
    • forItems(cb) - Calls back for each item in the project
    • forFilteredItems(filterFn, cb) - Calls back for each item for which the filterFn returned true
    • forSelections(cb) - Calls back with selections in this project
    • forCompositions(cb) - Calls back with compositions in this project
    • forCompositionsWithName(name, cb) - Calls back with compositions that match the given name
  • CompItem.prototype.
    • forLayers(cb) - Calls back for each layer in the composition
    • forSelectedLayers(cb) - Calls back for each selected layer in the composition

Console

It adds console.log and console.error support to JSX, errors will show up in your Panel's window as well as the chrome remote debugger, ExtendScript Toolkit and a logfile.

Bridge

The bridge provides a simple way to send a message from JSX to JS.

API documentation and examples

AE / Application (JSX)

Adds a couple of helper methods to AE's Application prototype.

Use

Add the following import to your project's index.jsx file:

index.js

require('extendscriptkit/jsx/ae/Application')

app.undoable('Some Action Description', () => {
  // everything you do within here will be undoable
})

app.faster(() => {
  // code within here that adds or modifies layers or composition will be faster.
  // It adds a temporary composition and focuses it so AE doesn't have to do a lot of re-draws.
  // After your code in here has ran, the temporary composition will be removed.
})

AE / Composition (JSX)

Adds a couple of helper methods to AE's CompItem prototype.

Use

Add the following import to your project's index.jsx file:

index.js

require('extendscriptkit/jsx/ae/Composition')

app.project.forCompositions(composition => { // see Project API
  composition.forLayers(layer => {
    // do something with layer
  })

  composition.forSelectedLayers(selectedLayer => {
    // do something with selected layer
  })
})

AE / Project (JSX)

Adds a couple of helper methods to AE's Project prototype.

Use

Add the following import to your project's index.jsx file:

index.js

require('extendscriptkit/jsx/ae/Project')

app.project.forItems(item => {
  // do something with item
})

app.project.forFilteredItems(
  item => item.name === 'Test',
  item => {
    // do something with item named 'Test'
  }
)

app.project.forSelections(selection => {
  // do something with selection
})

app.project.forCompositions(composition => {
  // do something with composition
})

app.project.forCompositionsWithName('compy', (composition) => {
  // do something with compositions named 'compy'
})

Bridge (JS / JSX)

The bridge allows communication between JS and JSX. On the JSX end it exposes a dispatch(type, data) method and On the JS end it exposes the CSInterface.

Use

Add the following imports to your project's index.js and index.jsx file:

index.js

const bridge = require('extendscriptkit/js/bridge')

bridge.addEventListener('MY_EVENT', data => {
  console.log(data)
})

index.jsx

const dispatch = require('extendscriptkit/jsx/bridge')

dispatch('MY_EVENT', 'Hello World')

Console (JS / JSX)

Shims the console in JSX files. The console.log's will go to the remote chrome debugger, ExtendScript Toolkit and the debug log file.

Additionally, console.error's will be written to panel's as well.

Use

Add the following imports to your project's index.js and index.jsx file:

index.js

const bridge = require('extendscriptkit/js/bridge')
require('extendscriptkit/js/console')(bridge)

index.jsx

require('extendscriptkit/jsx/console')

You can now use console.log() and console.error() in any JSX file.

License

Copyright (c) 2016 Koen Schmeets

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.