peter17/js-beautify-php

A JavaScript source code formatter written in PHP.

Fund package maintenance!
peter17

Installs: 325

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 4

pkg:composer/peter17/js-beautify-php

dev-master 2023-04-17 08:27 UTC

This package is auto-updated.

Last update: 2025-11-17 14:17:25 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]
    })
}