gulp-swiffy

1.1.1 • Public • Published

gulp-swiffy

Converts SWF files with the Google Swiffy online service.

Uses the swiffy-convert module.

Usage

var gulp   = require('gulp'),
    swiffy = require('gulp-swiffy');
 
gulp.task('mytask', function() {
  return gulp.src('flash/*.swf')
  .pipe(swiffy()) // same as swiffy('html'); it can be also swiffy('json')
  .pipe(gulp.dest('swiffy/'));
});

Then run your task:

$ gulp mytask

You can see convertion warnings and errors by setting the DEBUG environment variable to swiffy. Example:

$ DEBUG=swiffy gulp mytask

Alternatively, all messages are accessible within the file.data object. Example:

var gulp    = require('gulp'),
    swiffy  = require('gulp-swiffy'),
    through = require('through2');
 
gulp.task('mytask', function() {
  return gulp.src('flash/*.swf')
  .pipe(swiffy()) // same as swiffy('html'); it can be also swiffy('json')
  .pipe(through.obj(function(file, enc, callback) {
    if (file.data.swiffy != null && file.data.swiffy.messages != null) {
      console.log('WARNINGS for file ' + file.path);
      file.data.swiffy.messages.forEach(function(message) {
        console.log('' + message.type + ' ]', message.description);
      });
    }
    callback(null, file);
  }))
  .pipe(gulp.dest('swiffy/'));
});

API

swiffy(format, opts)

Format

Defaults to 'html'.

HTML

Converts the SWF file to HTML, using Google Swiffy. Just like manually uploading on the website, or converting with the Flash extension.

Example: swiffy('html')

JSON

After converting the SWF file, strips everything but the JSON data.

Example: swiffy('json')

Options

maxConcurrency

The maximum number of files to be converted at the same time.
Defaults to 10.

Example: swiffy('html', {maxConcurrency: 20})

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.1
    1
  • 1.0.0
    0
  • 0.1.2
    0

Package Sidebar

Install

npm i gulp-swiffy

Weekly Downloads

1

Version

1.1.1

License

MIT

Last publish

Collaborators

  • blvz