PHPackages                             thesmart/super-pack - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. thesmart/super-pack

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

thesmart/super-pack
===================

A package management tool that optimizes CSS and JavaScript download times

v0.0.1(13y ago)1171MITPHPPHP &gt;=5.3.0

Since Aug 6Pushed 13y agoCompare

[ Source](https://github.com/thesmart/php-SuperPack)[ Packagist](https://packagist.org/packages/thesmart/super-pack)[ Docs](https://github.com/thesmart/php-SuperPack)[ RSS](/packages/thesmart-super-pack/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

SuperPack by John Smart ([@thesmart](https://github.com/thesmart))
==================================================================

[](#superpack-by-john-smart-thesmart)

A package management tool that optimizes CSS and JavaScript download times

Organize your static files into packs (packages). Packs can be developed and debugged while in development mode. Once put into production mode, packs are run through Closure Compiler. This optimizes the payload while preserving script execution order.

TODO List
---------

[](#todo-list)

- Create a cache backed library to compile scripts using Closure Compiler
- Create script to upload files to Amazon S3, Akamai, and other popular CDNs

Example
-------

[](#example)

Start by creating your package managers

```
// create instances of JS and CSS package managers
global $JS_PACK, $CSS_PACK;
JsPack::setInstance($JS_PACK = new JsPack());
CssPack::setInstance($CSS_PACK = new CssPack());

```

Then, register your packages. Packages can consist of:

1. Relative paths
2. Absolute paths
3. Plain-text scripts
4. Markup

Defining your packages once in index.html. Note that it is best to create separate packages for separate pages in your site

```
// build a large pack for all of your common JavaScript
define('JS_BASE', 'JS_BASE');
$JS_PACK->register(JS_BASE, array(
	'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js',
	'/js/ender/node_modules/underscore/underscore.js',
	'/js/ender/node_modules/backbone/backbone.js',
	'/js/bootstrap/bootstrap-button.js',
	'/js/bootstrap/bootstrap-collapse.js',
	'/js/bootstrap/bootstrap-modal.js',
	'/js/bootstrap/bootstrap-alert.js',
	'/js/bootstrap/bootstrap-carousel.js',
	'/js/bootstrap/bootstrap-tooltip.js',
));

// create additional packs for supplemental pages
define('JS_PROFILE', 'JS_PROFILE');
$JS_PACK->register(JS_PROFILE, array(
	'alert("Hello, dear user.");',
	'alert("this also works.");'
));
```

During run-time, you can declare a dependency on a package easily:

```
$JS_PACK->inclHead(JS_BASE);
$JS_PACK->inclHead(JS_PROFILE);
```

You can also inject scripts directly:

```
foreach (array('alert', 'me', 'thrice') as $msg) {
	$JS_PACK->inclDomReady(sprintf("alert(%s)", json_encode($msg)));
}
```

Internet Explorer hacks can also be managed with version control:

```
$JS_PACK->inclIE('/js/html5.js', 6, 8);
// ideally, this would be included in a package, too
//$JS_PACK->inclIE(JS_IE_FIXES);
```

Everything supported by JsPack is also support for CSS:

```
define('CSS_BASE', 'CSS_BASE');
$CSS_PACK->register(CSS_BASE, array(
	'/less/bootstrap.css'
));

// ...later during run-time
$CSS_PACK->inclHead(CSS_BASE);
```

Render the scripts into your markup templates:

```

	Hello World.

```

The output might look like this:

```
>

alert("Hello, dear user.");

alert("this also works.");

	Hello World.

alert("alert")

alert("me")

alert("thrice")

```

Like this project?
------------------

[](#like-this-project)

Check out my others. [@thesmart](https://twitter.com/thesmart)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

5075d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/11f682ea6d98e41ccb56db0a284ac5b085fd31d40c3119cf8c3e493f87498c0a?d=identicon)[thesmart](/maintainers/thesmart)

---

Top Contributors

[![thesmart](https://avatars.githubusercontent.com/u/280877?v=4)](https://github.com/thesmart "thesmart (7 commits)")

---

Tags

javascriptpackagecssstaticoptimizepackage-manager

### Embed Badge

![Health badge](/badges/thesmart-super-pack/health.svg)

```
[![Health](https://phpackages.com/badges/thesmart-super-pack/health.svg)](https://phpackages.com/packages/thesmart-super-pack)
```

###  Alternatives

[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k32.3M424](/packages/matthiasmullie-minify)[composer/satis

Simple Repository Generator

3.3k1.4M19](/packages/composer-satis)[stolz/assets

An ultra-simple-to-use assets management library

289527.4k8](/packages/stolz-assets)[janmarek/webloader

Tool for loading or deploying CSS and JS files into web pages

107516.7k14](/packages/janmarek-webloader)[axy/sourcemap

Work with JavaScript/CSS Source Map

25756.3k7](/packages/axy-sourcemap)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40140.4k2](/packages/erlandmuchasaj-laravel-gzip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
