peter17/js-beautify-php

A JavaScript source code formatter written in PHP.

Maintainers

Package info

github.com/peter17/js-beautify-php

pkg:composer/peter17/js-beautify-php

Fund package maintenance!

peter17

Statistics

Installs: 360

Dependents: 0

Suggesters: 0

Stars: 1

v1.0.0 2026-02-23 21:26 UTC

This package is auto-updated.

Last update: 2026-03-23 21:43:24 UTC


README

$obj = new JSBeautify('function escapeHtml(string){return String(string).replace(/[&<>"'`=\/]/g,function fromEntityMap(s){return entityMap[s]})}');
echo $obj->getResult();

the output will be

function escapeHtml(string) {
    return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
        return entityMap[s]
    })
}