PHPackages                             netherphp/onescript - 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. netherphp/onescript

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

netherphp/onescript
===================

A silly Javascript Compiler.

v4.0.2(4y ago)0361[1 PRs](https://github.com/netherphp/onescript/pulls)2BSD-3-ClausePHPPHP &gt;=8.0

Since Jul 14Pushed 3y agoCompare

[ Source](https://github.com/netherphp/onescript)[ Packagist](https://packagist.org/packages/netherphp/onescript)[ RSS](/packages/netherphp-onescript/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (18)Used By (2)

Nether OneScript
================

[](#nether-onescript)

A silly Javascript "Compiler"

The only things I dislike more than Javascript are other people's Javascript frameworks and build systems. So like a complete tool I wrote my own that works in the way I typically build my scripts.

Use Case
========

[](#use-case)

Pretending our website project is setup like this.

- Our Project Root: `/opt/website`
- Our Public Root: `/opt/website/www`
- A JS Lib We Wrote: `/opt/website/www/share/mylib`
- So our shell sits in `/opt/website` most of the time.

And our JS Lib `mylib` is structured like this.

- `src/mylib-main.js`
- `src/mylib-whatever.js`
- `src/libs/extension1.js`
- `src/libs/extension2.js`

Quick Start
===========

[](#quick-start)

This library provides a vendor bin file. On Windows you will need to run it as `vendor\bin\nether-onescript` while upon anything else you will need to call it as `php vendor/bin/nether-onescript` - I will use the NotWindows notation since thats what any sane server is.

```
php vendor/bin/nether-onescript help

```

Creating a new OneScript project.
=================================

[](#creating-a-new-onescript-project)

OneScript expects the project source files to be within the `src` directory. By default it wil use `libs` as the module directory looking for the `js`extension. So the command required for our example project above:

```
php vendor/bin/nether-onescript create www/share/mylib \
--files=mylib-main.js,mylib-whatever.js

```

This will create `onescript.json` (which can be changed by --filename) in `www/share/jslib/` - in this JSON file you can see all the options available to change. You will notice that it will have added the main files you listed on the command line in the Files option, and automatically listed `libs` in the Directories option with `js` in the Extenions option. It also will have set the OutputFile to `onescript.js` as well.

Building the OneScript project via CLI.
=======================================

[](#building-the-onescript-project-via-cli)

```
php vendor/bin/nether-onescript build www/share/mylib/onescript.json

```

Assuming there are no errors like file permissions or missing files, this will compile your OneScript project down into `onescript.js` - your potentially final file for distribution.

The build system works like so:

- Load the `Files` and bake them into a single file, in the order you specified.
- Next it will go through each of the `Directories` looking for files with the extensions listed in `Extensions` and bake them to the end of the file. It will save that as your `OutputFile` as the final product.
- Once Minify support is done, it will then pass that through the minification process to create the `OutputMinFile` - the minification feature is not yet impelemented.

Building the OneScript project via a live compiler.
===================================================

[](#building-the-onescript-project-via-a-live-compiler)

Sometimes it is handy, like on your dev server, to have the projects built automaticaly every time you change them. For my example here I would probably create a new file called `onescript.js.php` in my JS project folder.

```
$project = Nether\OneScript\Project::FromFile(sprintf(
	'%s/onescript.json',
	dirname(__FILE__)
));

$project->Print = true;
$project->Build();

```

If you reference this `onescript.js.php` in your script tag it will be built every time the page is loaded and the files have changed. You won't realy want to commit this to your prodution space.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity77

Established project with proven stability

 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

Every ~148 days

Recently: every ~333 days

Total

16

Last Release

1740d ago

Major Versions

v1.1.4 → v2.0.02016-02-26

v2.0.1 → v3.0.02017-08-20

v3.0.4 → v4.0.02021-01-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/b64ee49e86efa67a7de4afdc42c2686460d1e46ac7eac7e6ccfa6407ec7d979a?d=identicon)[bobmagicii](/maintainers/bobmagicii)

---

Top Contributors

[![bobmagicii](https://avatars.githubusercontent.com/u/881944?v=4)](https://github.com/bobmagicii "bobmagicii (22 commits)")

---

Tags

phpjavascriptcompiler

### Embed Badge

![Health badge](/badges/netherphp-onescript/health.svg)

```
[![Health](https://phpackages.com/badges/netherphp-onescript/health.svg)](https://phpackages.com/packages/netherphp-onescript)
```

###  Alternatives

[hisune/echarts-php

A php wrapper for echarts javascript libraries

327201.9k5](/packages/hisune-echarts-php)

PHPackages © 2026

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