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

@gizeta/swf-reader

v1.0.0

Published

A simple node module for reading SWF format

Downloads

176

Readme

SWF Reader

A simple node module for reading SWF format.

Forked from https://github.com/rafaeldias/swf-reader.

Installation

$ npm install @gizeta/swf-reader

Usage

var SWFReader = require('@gizeta/swf-reader');

SWFReader.read( 'swf_path.swf', function(err, swf) {
  if ( err ) {
    // handle error
    ...
  }
  console.log(swf);
});

SWFReader.read(file, callback)

Returns a SWF Object to callback function. If it's not possible to read the SWF, an error object is passed as the first argument of callback.

SWFReader.readSync(file)

Returns a SWF Object to the caller. If it's not possible to read the SWF, an Exception is thrown.

The file parameter of both methods may be either a file path or a buffer of the SWF file.

SWF Object

The SWF Object method has the following properties :

  • version: The SWF version.
  • fileLength: An Object containing the following properties :
    • compressed: The SWF compressed size in bytes.
    • uncompressed: The SWF uncompressed size in bytes.
  • frameSize: An Object containing the width and height of the SWF.
  • frameRate: The SWF framerate.
  • frameCount: Number of frames in the SWF.
  • backgroundColor: The background color of the SWF in the format #XXXXXX.
  • fileAttributes: FileAtributtes defines characteristics of the SWF file.
    • useNetwork: If true, the SWF file is given network file access when loaded locally.
    • as3: If true, the SWF uses ActionScript 3.0. Otherwise it uses ActionScript 1.0 or 2.0.
    • hasMetaData: If true, the SWF file contains the Metadata tag.
    • useGPU: If true, the SWF file uses GPU compositing features when drawing graphics.
    • useDirectBlit: If true, the SWF file uses hardware acceleration to blit graphics to the screen.
  • metadata: The metadata describes the SWF file to and external process.
  • tags: An array of tag. Each item in the array is an object with a header property with the folowing properties:
    • code: A number indicating the type of the tag. (see SWF format for more information)
    • length: The length of the tag in bytes.

Running test

To run the test invoke the following command within the repo directory :

$ npm test

Todo

  • Read tags fields.
  • Write in tags block.

Contributors

Original Author: Rafael Leal Dias

License

MIT