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 🙏

© 2026 – Pkg Stats / Ryan Hefner

flbuild

v0.2.1

Published

Build Adobe Flash and Flex

Readme

Flash / Flex Build Support

Build Status Dependency Status

Install

$ npm install flbuild --save-dev

Create swc library

var fl = require('flbuild')
var exec = require('done-exec')

var config = new fl.Config()
config.setEnv('FLEX_HOME')
config.setEnv('PROJECT_HOME', '/project/home')
config.setEnv('PLAYER_VERSION', '11.9')
config.addExternalLibraryDirectory('$FLEX_HOME/frameworks/libs/player/$PLAYER_VERSION')
config.addExternalLibraryDirectory('$FLEX_HOME/frameworks/libs/')
config.addExternalLibraryDirectory('$FLEX_HOME/frameworks/libs/mx/')
config.addExternalLibraryDirectory('$FLEX_HOME/frameworks/locale/en_US/')
config.addLibraryDirectory('$PROJECT_HOME/libs/')
config.addSourceDirectory('$PROJECT_HOME/src')

var lib = new fl.Lib(config)
// If you want filter your classes for import to swc.
// you can do it with using `fl.Lib.filterFunction`
lib.filterFunction = function (asclass) {
    return asclass.classpath.indexOf('mailer.') > -1
}

lib.createBuildCommand('$PROJECT_HOME/bin/lib.swc', function (cmd) {
    console.log('lib =>', cmd)
    exec(cmd).run(function () {
        console.log('<= lib')
    })
})

Write namespace.yaml

If you want set custom namespace for your component classes. (like xmlns:mx or xmlns:s)

You can do it with writing namespace.yaml

  • src
    • com
      • yourdomain
        • ComponentClass1
        • ComponentClass2
        • ComponentClass3
        • namespace.yaml

Create namespace.yaml file in your namespace directory like that.

namespace: "http://yourdomain.com/somens"
components:
- ComponentClass1
- ComponentClass2
- ComponentClass3

And write namespace and components names.

<?xml version="1.0"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         xmlns:somens="http://yourdomain.com/somens">
    <somens:Component1 />
    <somens:Component2 />
    <somens:Component3 />
</s:Group>

Then you can use your library with custom namespace.

Create application and module swf files

var fl = require('flbuild')
var exec = require('done-exec')

var config = new fl.Config()
config.setEnv('FLEX_HOME')
config.setEnv('PROJECT_HOME', '/project/home')
config.setEnv('PLAYER_VERSION', '11.9')
config.addExternalLibraryDirectory('$FLEX_HOME/frameworks/libs/player/$PLAYER_VERSION')
config.addLibraryDirectory('$FLEX_HOME/frameworks/libs/')
config.addLibraryDirectory('$FLEX_HOME/frameworks/libs/mx/')
config.addLibraryDirectory('$FLEX_HOME/frameworks/locale/en_US/')
config.addLibraryDirectory('$PROJECT_HOME/libs/')
config.addSourceDirectory('$PROJECT_HOME/src')

var app = new fl.App(config)
app.addArg('-debug=false')
app.addArg('-compress=true')
app.addArg('-optimize=true')
app.createBuildCommand('$PROJECT_HOME/src/App.mxml', '$PROJECT_HOME/bin-debug/App.swf', function (cmd) {
    console.log('app =>', cmd)
    exec(cmd).run(function () {
        console.log('<= app')
    })
})

var module = new fl.Module(config)
module.addArg('-debug=false')
module.addArg('-compress=true')
module.addArg('-optimize=true')
module.createBuildCommand('$PROJECT_HOME/bin-debug/App.xml', '$PROJECT_HOME/src/modules/Module.mxml', '$PORJECT_HOME/bin-deubg/modules/Module.swf', function (cmd) {
    console.log('module =>', cmd)
    exec(cmd).run(function () {
        console.log('<= module')
    })
})

fl.App build command will be make files App.swf, App.xml and App.size.xml.

App.xml is report file for module optimization. It can using when create sub module.

If you want create library with swf files

var fl = require('flbuild')
var exec = require('done-exec')

var config = new fl.Config()
config.setEnv('FLEX_HOME')
config.setEnv('PROJECT_HOME', '/project/home')
config.setEnv('PLAYER_VERSION', '11.9')
config.addExternalLibraryDirectory('$FLEX_HOME/frameworks/libs/player/$PLAYER_VERSION')
config.addLibraryDirectory('$PROJECT_HOME/libs/')
config.addSourceDirectory('$PROJECT_HOME/src')

var lib = new fl.Lib(config)
lib.addExternalLibraryDirectory('$FLEX_HOME/frameworks/libs/')
lib.addExternalLibraryDirectory('$FLEX_HOME/frameworks/libs/mx/')
lib.addExternalLibraryDirectory('$FLEX_HOME/frameworks/locale/en_US/')
lib.createBuildCommand('$PROJECT_HOME/bin/lib.swc', function (cmd) {
    exec(cmd).run()
})

var app = new fl.App(config)
app.addLibraryDirectory('$FLEX_HOME/frameworks/libs/')
app.addLibraryDirectory('$FLEX_HOME/frameworks/libs/mx/')
app.addLibraryDirectory('$FLEX_HOME/frameworks/locale/en_US/')
app.createBuildCommand('$PROJECT_HOME/src/App.mxml', '$PROJECT_HOME/bin-debug/App.swf', function (cmd) {
    exec(cmd).run()
})

var module = new fl.Module(config)
module.addLibraryDirectory('$FLEX_HOME/frameworks/libs/')
module.addLibraryDirectory('$FLEX_HOME/frameworks/libs/mx/')
module.addLibraryDirectory('$FLEX_HOME/frameworks/locale/en_US/')
module.createBuildCommand('$PROJECT_HOME/bin-debug/App.xml', '$PROJECT_HOME/src/modules/Module.mxml', '$PORJECT_HOME/bin-deubg/modules/Module.swf', function (cmd) {
    exec(cmd).run()
})

If you need create swc library with swf applications. You can set different libraries and args each modules. (because mxmlc need import flex libraries. but, compc no need flex libraries.)

With gulpfile.js

You can make flbuild into one of gulpfile tasks. It is better for your build.

var gulp = require('gulp')
var fl = require('flbuild')
var exec = require('done-exec')
var run = require('gulp-sequence')

var config = new fl.Config()
config.setEnv('FLEX_HOME')
config.setEnv('PROJECT_HOME', '/project/home')
config.setEnv('PLAYER_VERSION', '11.9')
config.addExternalLibraryDirectory('$FLEX_HOME/frameworks/libs/player/$PLAYER_VERSION')
config.addExternalLibraryDirectory('$FLEX_HOME/frameworks/libs/')
config.addExternalLibraryDirectory('$FLEX_HOME/frameworks/libs/mx/')
config.addExternalLibraryDirectory('$FLEX_HOME/frameworks/locale/en_US/')
config.addLibraryDirectory('$PROJECT_HOME/libs/')
config.addSourceDirectory('$PROJECT_HOME/src')

gulp.task('create-library', function (done) {
    var lib = new fl.Lib(config)
    lib.createBuildCommand('$PROJECT_HOME/bin/lib.swc', function (cmd) {
        exec(cmd).run(done)
    })
})

gulp.task('some-task', function () {
    // task code
})

gulp.task('default', run(['some-task', 'create-library']))

API

class fl.Config

  • constructor(parent?:fl.Config)
  • setEnv(name:string, value?:string) If value is null. Read value from system environment variables.
  • getEnv(name:string):string
  • addLibraryDirectory(path:string)
  • addExternalLibraryDirectory(path:string)
  • addSourceDirectory(path:string)
  • addArg(arg:string) mxmlc, compc options
  • getLibraryDirectories():string[]
  • getExternalLibraryDirectories():string[]
  • getSourceDirectories():string[]
  • getArgs():string[]

class fl.App extends fl.Config

  • constructor(config:fl.Config)
  • createBuildCommand(mxmlPath: string, swfPath: string, complete: (command: string) => void)

class fl.Module extends fl.Config

  • constructor(config:fl.Config)
  • createBuildCommand(appReportPath: string, mxmlPath: string, swfPath: string, complete: (command: string) => void)

class fl.Lib extends fl.Config

  • constructor(config:fl.Config)
  • filterFunction: (asclass: fl.ASClass) => boolean
  • createBuildCommand(swcPath: string, complete: (command: string) => void)

interface fl.ASClass

  • path:string = '/project/path/src/your/namespace/Class.as'
  • relative_path:string = 'your/namespace/Class.as'
  • base:string = '/project/path/src/your/namespace'
  • relative_base:string = 'your/namespace'
  • name:string = 'Class'
  • extension:string = '.as'
  • atime:number = 1430095512987 (from Date.getTime())
  • mtime:number = 1430095512987
  • ctime:number = 1430095512987
  • classpath:string = 'your.namespace.Class'