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

webcg-framework

v2.6.0

Published

Framework to create HTML templates and graphic overlays for WebCG and CasparCG

Downloads

40

Readme

webcg-framework

webcg-framework is a framework to create and develop HTML templates for CasparCG and WebCG. The framework provides an API to listen for AMCP commands, executes your handlers asynchronously waiting for their completion using Promises, automatically parses the XML or JSON data to a JavaScript object, and provides a lazy-load injection for the webcg-devtools.

Running examples can be found at http://indr.github.io/webcg-framework/ and https://indr.github.io/webcg-adobe-animate-adapter/.

Installation

Download the latest release and extract and copy the files in the same folder as your HTML template. Add a script reference webcg-framework.umd.js in your HTML file like:

<script src="webcg-framework.umd.js"></script>

You must not add a reference to webcg-devtools.umd.js. If you open your template in a browser and add ?debug=true to bring up the DevTools, the framework will lazyingly load webcg-devtools.umd.js from the same directory.

API

Have a look at the example lower-third template to see how to use the API. A live version of this template can be found at https://indr.github.io/webcg-framework/lower-third-css-animations.html?debug=true.

Methods

The webcg-framework exposes a global object webcg with these methods:

addEventListener(type, listener)

Register an event handler to a specific event type and/or AMCP command.

type: A case-sensitive string representing the event type, AMCP command and/or invoked function to listen for. For example play, stop, update, data, myfunc1.

listener: The JavaScript function that receives a notification when an event of the specified type occurs. Return a Promise to delay processing until your handler is complete (for example, loading images, waiting for animations to complete).

removeEventListener(type, listener)

Removes an event listener.

on(type, listener)

Alias for addEventListener()

off(type, listener)

Alias for removeEventListener()

Events

| Type | Description | | ---- | ----------- | | play | Fired when the template should play the intro animations and become visible. | | stop | Fired when the template should play the outro animations and become invisible. | | next | Fired when the template should move the the next step in a multi step template (for example paged lists). | | update | Fired when the template receives raw data. | | data | Fired after update with the raw data parsed as a JSON object. Handles component XML data, JSON strings and JavaScript objects. |

Contributing

npm run build builds the library to dist.
npm run dev builds the library, then keeps rebuilding it whenever the source files change.
npm run test run the unit tests in watch mode.
npm run demo starts a demo at localhost:8080.

Copyright and License

Copyright (c) 2018 Reto Inderbitzin, MIT License