
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
oro-php-locutus
Advanced tools
Fork of few Locutus functions that have been rewritten in TypeScript.
Locutus is a project that seeks to assimilate other languages’ standard libraries to JavaScript.
Locutus is a huge library created by a community effort, so instead of downloading all their code, this is just a piece of it.
This package is a fork of few Locutus functions that have been rewritten in TypeScript.
These functions have no dependencies and are browser friendly.
npm install oro-php-locutus
serialize( mixedValue: any ): string
Here's what Locutus JavaScript equivalent to PHP's serialize looks like.
// cjs
const { serialize } = require( 'oro-php-locutus' );
// mjs, ts
import { serialize } from 'oro-php-locutus';
serialize( { chacho: true, tio: 17 } );
// 'a:2:{s:6:"chacho";b:1;s:3:"tio";i:17;}'
serialize( [ 'chacho', '', true, false, 1, 2.3 ] );
// 'a:6:{i:0;s:6:"chacho";i:1;s:0:"";i:2;b:1;i:3;b:0;i:4;i:1;i:5;d:2.3;}'
unserialize( str: string ): string
Here's what Locutus JavaScript equivalent to PHP's unserialize looks like.
// cjs
const { unserialize } = require( 'oro-php-locutus' );
// mjs, ts
import { unserialize } from 'oro-php-locutus';
unserialize( 'a:2:{s:6:"chacho";b:1;s:3:"tio";i:17;}' );
// { chacho: true, tio: 17 }
unserialize( 'a:6:{i:0;s:6:"chacho";i:1;s:0:"";i:2;b:1;i:3;b:0;i:4;i:1;i:5;d:2.3;}' );
// [ 'chacho', '', true, false, 1, 2.3 ]
htmlspecialchars(
string: string,
quoteStyle?: ENT_OPTION | ENT_OPTION[],
charset?: null,
doubleEncode?: boolean
): string
type ENT_OPTION =
| 0 | 'ENT_NOQUOTES'
| 1 | 'ENT_HTML_QUOTE_SINGLE'
| 2 | 'ENT_HTML_QUOTE_DOUBLE'
| 'ENT_COMPAT'
| 3 | 'ENT_QUOTES'
| 4 | 'ENT_IGNORE'
Here's what Locutus JavaScript equivalent to PHP's unserialize looks like.
// js
const { htmlspecialchars } = require( 'oro-php-locutus' );
// ts
import { htmlspecialchars } from 'oro-php-locutus';
htmlspecialchars( '<a href="test">Test</a>', 'ENT_QUOTES' );
// '&lt;a href=&quot;test&quot;&gt;Test&lt;/a&gt;'
utf8Encode( str: string ): string
Here's what Locutus JavaScript equivalent to PHP's unserialize looks like.
// cjs
const { utf8Encode } = require( 'oro-php-locutus' );
// mjs, ts
import { utf8Encode } from 'oro-php-locutus';
utf8Encode( 'Chacho' );
// 'Chacho'
utf8Encode( 'cañón' );
// 'cañón'
utf8Decode( str: string ): string
Here's what Locutus JavaScript equivalent to PHP's unserialize looks like.
// cjs
const { utf8Decode } = require( 'oro-php-locutus' );
// mjs, ts
import { utf8Decode } from 'oro-php-locutus';
utf8Decode( 'Chacho' );
// 'Chacho'
utf8Decode( 'cañón' );
// 'cañón'
md5( str: string ): string
Here's what Locutus JavaScript equivalent to PHP's unserialize looks like.
// cjs
const { md5 } = require( 'oro-php-locutus' );
// mjs, ts
import { md5 } from 'oro-php-locutus';
md5( 'chacho' );
// '496c84fb22e82d68fad9e5fe8e89d03d'
2.1.6 / 2025-03-08
package-lock.json
.tsconfig.json
.clean
and build
scripts.@babel/core
from v7.26.0
to v7.26.9
.@babel/preset-env
from v7.26.0
to v7.26.9
.@eslint/js
from v9.16.0
to v9.22.0
.@trivago/prettier-plugin-sort-imports
from v5.2.0
to v5.2.2
.eslint
from v9.16.0
to v9.22.0
.eslint-config-prettier
from v9.1.0
to v10.1.1
.eslint-plugin-jest
from v28.9.0
to v28.11.0
.eslint-plugin-prettier
from v5.2.1
to v5.2.3
.eslint-plugin-unicorn
from v56.0.1
to v57.0.0
.globals
from v15.13.0
to v16.0.0
.prettier
from v3.4.2
to v3.5.3
.tsup
from v8.3.5
to v8.4.0
.typescript
from v5.7.2
to v5.8.2
.typescript-eslint
from v8.18.0
to v8.26.0
.FAQs
Fork of few Locutus functions that have been rewritten in TypeScript.
We found that oro-php-locutus demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.