Extract resources from SWF using the open-source JPEXS jar library (already embedded in this library). You need to install Java v8.* to use this package.
npm install @marcuth/jpexs-decompiler
import * as jpexs from "@marcuth/jpexs-decompiler"
// or import { extract, Item, FontFormat } from "@marcuth/jpexs-decompiler"
jpexs.extract({
file: "path/to/swf/file",
output: "path/to/output/dir",
items: [jpexs.Item.Font, ...],
formats: [jpexs.FontFormat.Woff, ...],
silence: false // optional. if set to `true`, there"s no console log.
}).then(() => {
console.log("DONE!")
}).catch((err) => {
console.log("Error: ", err.message)
})| Item | Description | Default Format |
|---|---|---|
Item.Script |
Scripts | ActionScript source |
Item.Image |
Images | PNG/JPEG |
Item.Shape |
Shapes | SVG |
Item.MorphShape |
MorphShapes | SVG |
Item.Movie |
Movies | FLV without sound |
Item.Font |
Fonts | TTF |
Item.Frame |
Frames | PNG |
Item.Sprite |
Sprites | PNG |
Item.Button |
Buttons | PNG |
Item.Sound |
Sounds | MP3/WAV/FLV only sound |
Item.Binary |
Binary data | Raw data |
Item.Text |
Texts | Plain text |
Item.Fla |
Everything to FLA compressed format | - |
Item.All |
Every resource (but not FLA) | - |
| Category | Option | Description |
|---|---|---|
| Script | ScriptFormat.As |
ActionScript source |
ScriptFormat.Hex |
ActionScript Hex only | |
ScriptFormat.Pcode |
ActionScript P-code | |
ScriptFormat.PcodeHex |
ActionScript P-code with hex | |
| Shape | ShapeFormat.Svg |
SVG format for Shapes |
ShapeFormat.Bmp |
BMP format for Shapes | |
ShapeFormat.Png |
PNG format for Shapes | |
ShapeFormat.Canvas |
HTML5 Canvas format for Shapes | |
| Morph Shape | MorphShapeFormat.Svg |
SVG format for MorphShapes |
MorphShapeFormat.Canvas |
HTML5 Canvas format for MorphShapes | |
| Frame | FrameFormat.Bmp |
BMP format for Frames |
FrameFormat.Png |
PNG format for Frames | |
FrameFormat.Gif |
GIF format for Frames | |
FrameFormat.Pdf |
PDF format for Frames | |
FrameFormat.Avi |
AVI format for Frames | |
FrameFormat.Svg |
SVG format for Frames | |
FrameFormat.Canvas |
HTML5 Canvas format for Frames | |
| Sprite | SpriteFormat.Png |
PNG format for Sprites |
SpriteFormat.Gif |
GIF format for Sprites | |
SpriteFormat.Avi |
AVI format for Sprites | |
SpriteFormat.Svg |
SVG format for Sprites | |
SpriteFormat.Pdf |
PDF format for Sprites | |
SpriteFormat.Bmp |
BMP format for Sprites | |
SpriteFormat.Canvas |
HTML5 Canvas format for Sprites | |
| Button | ButtonFormat.Png |
PNG format for Buttons |
ButtonFormat.Svg |
SVG format for Buttons | |
ButtonFormat.Bmp |
BMP format for Buttons | |
| Image | ImageFormat.Bmp |
BMP format for Images |
ImageFormat.Png |
PNG format for Images | |
ImageFormat.Jpeg |
JPEG format for Images | |
ImageFormat.All |
PNG/GIF/JPEG format for Images | |
| Text | TextFormat.Svg |
SVG format for Texts |
TextFormat.Plain |
Plain text format for Texts | |
TextFormat.Formatted |
Formatted text format for Texts | |
| Font | FontFormat.Ttf |
TTF format for Fonts |
FontFormat.Woff |
WOFF format for Fonts | |
| Sound | SoundFormat.Flv |
FLV format for Sounds |
SoundFormat.Wav |
WAV format for Sounds | |
SoundFormat.All |
MP3/WAV/FLV format for Sounds |
- Want to contribute? Follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b new-feature). - Commit your changes (
git commit -m 'Add new feature'). - Push to the branch (
git push origin new-feature). - Open a Pull Request.
This project carries the license of the project from which it was forked, which is the GNU General Public License v3.0.