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

@shockpkg/dir-projector

v6.0.8

Published

Package for creating Shockwave Director projectors

Downloads

810

Readme

DIR Projector

Package for creating Shockwave Director projectors

npm node

size downloads

main

Overview

Creates Shockwave Director projectors from a projector skeleton.

Takes either a directory containing a skeleton or an archive containing a skeleton (shockpkg package file). Can also generate HTML files to embed content.

Can also create bundles that group the projector and resources in a directory beside a single launcher for Windows or within an application bundle for macOS.

Reading DMG projector packages is only supported on macOS, using ZIP packages instead is recommended.

Currently only flat projectors are supported, not the kind that Director makes where everything is appended to the main binary in some format, and extracted to a temporary directory when run.

Usage

Projector

Projector Otto

Projector Otto Windows

import {ProjectorOttoWindows} from '@shockpkg/dir-projector';

const projector = new ProjectorOttoWindows('projector-windows/application.exe');

// Required skeleton.
projector.skeleton = 'skeleton.zip';

// File to create config file with.
projector.configFile = 'config.ini';

// Optional custom icon.
projector.iconFile = 'icon.ico';

// Optional custom PE resource strings.
projector.versionStrings = {
	FileVersion: '3.1.4',
	ProductVersion: '3.1.4',
	CompanyName: 'Custom Company Name',
	FileDescription: 'Custom File Description',
	LegalCopyright: 'Custom Legal Copyright',
	ProductName: 'Custom Product Name',
	LegalTrademarks: 'Custom Legal Trademarks',
	OriginalFilename: 'CustomOriginalFilename.exe',
	InternalName: 'CustomInternalName',
	Comments: 'Custom Comments'
};

// Optional Lingo startup script.
projector.lingoFile = 'lingo.ini';

// Optional splash screen image.
projector.splashImageFile = 'splash.bmp';

// Optionally use system installed Shockwave libraries.
// projector.shockwave = true;

// Xtras included (all in this case).
projector.includeXtras = {
	'': null
};

// Optionally nest Xtras in Configuration directory.
projector.nestXtrasConfiguration = true;

// Optionally fix Shockwave 3D Xtra InstalledDisplayDrivers reading.
projector.patchShockwave3dInstalledDisplayDriversSize = true;

await projector.write();

Projector Otto Mac

import {ProjectorOttoMac} from '@shockpkg/dir-projector';

const projector = new ProjectorOttoMac('projector-mac/application.app');

// Required skeleton.
projector.skeleton = 'skeleton.zip';

// File to create config file with.
projector.configFile = 'config.ini';

// Optional custom icon.
projector.iconFile = 'icon.icns';

// Optionally change main binary name.
projector.binaryName = 'application';

// Optionally base Info.plist file.
projector.infoPlistFile = 'Info.plist';

// Optionally custom PkgInfo file.
projector.pkgInfoFile = 'PkgInfo';

// Optionally update bundle name.
projector.bundleName = 'application';

// Optional Lingo startup script.
projector.lingoFile = 'lingo.ini';

// Optional splash screen image.
projector.splashImageFile = 'splash.pict';

// Optionally use system installed Shockwave libraries.
// projector.shockwave = true;

// Xtras included (all in this case).
projector.includeXtras = {
	'': null
};

// Optionally nest Xtras in Configuration directory.
// projector.nestXtrasConfiguration = true;

// Optionally nest Xtras inside the app Contents directory.
projector.nestXtrasContents = true;

// Optionally use Intel-only skeleton.
// projector.intel = true;

await projector.write();

Projector HTML

import {ProjectorHtml} from '@shockpkg/dir-projector';

const projector = new ProjectorHtml('projector-html/application.html');

// Required properties.
projector.src = 'movie.dir';
projector.width = 640;
projector.height = 480;

// Optionally configure HTML document.
p.lang = 'en-US';
p.title = 'A "special" title with <html> characters';
p.background = '#000000';
p.color = '#999999';

// Optionally configure object/param/embed elements.
p.bgcolor = '#000000';
p.id = 'element-id';
p.name = 'element-name';
p.codebase =
	'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=12,0,0,112';
p.pluginspage = 'http://www.macromedia.com/shockwave/download/';
p.swStretchStyle = 'none';
p.swStretchHAlign = 'center';
p.swStretchVAlign = 'center';
p.swRemote =
	"swSaveEnabled='false' swVolume='false' swRestart='false' swPausePlay='false' swFastForward='false' swContextMenu='true'";
p.sw1 = 'one';
p.sw2 = 'two';
p.sw3 = 'three';
p.sw4 = 'four';
p.sw5 = 'five';
p.sw6 = 'six';
p.sw7 = 'seven';
p.sw8 = 'eight';
p.sw9 = 'nine';
p.progress = false;
p.logo = false;
p.playerVersion = 12;

await projector.write();

Bundle

Bundle Otto

Bundle Otto Windows

import {BundleOttoWindows} from '@shockpkg/dir-projector';

const bundle = new BundleOttoWindows('bundle-windows/application.exe');

// Use projector property to set options.
bundle.projector.skeleton = 'skeleton.zip';

// File to create config file with.
bundle.projector.configFile = 'config.ini';

await bundle.write(async b => {
	// Add resources in callback.
	await b.copyResource('movie.dir', 'movie.dir');
});

Bundle Otto Mac

import {BundleOttoMac} from '@shockpkg/dir-projector';

const bundle = new BundleOttoMac('bundle-mac/application.app');

// Use projector property to set options.
bundle.projector.skeleton = 'skeleton.zip';

// File to create config file with.
bundle.projector.configFile = 'config.ini';

await bundle.write(async b => {
	// Add resources in callback.
	await b.copyResource('movie.dir', 'movie.dir');
});

Bundle HTML

import {BundleHtml} from '@shockpkg/dir-projector';

const bundle = new BundleHtml('bundle-html/application.html');

// Use projector property to set options.
bundle.projector.src = 'movie.dir';
bundle.projector.width = 640;
bundle.projector.height = 480;

await bundle.write(async b => {
	// Add resources in callback.
	await b.copyResource('movie.dir', 'movie.dir');
});

A bundle can also be made "flat" into an empty directory without nesting the resources or adding a launcher stub by passing true as the second argument to the constructor.

Bugs

If you find a bug or have compatibility issues, please open a ticket under issues section for this repository.

License

Copyright (c) 2019-2024 JrMasterModelBuilder

Licensed under the Mozilla Public License, v. 2.0.

If this license does not work for you, feel free to contact me.