
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@remotex-labs/xplist
Advanced tools
A lightweight library for encoding and decoding property lists (plist) in both `plist` and `binary` formats.
A lightweight TypeScript/JavaScript library for encoding and decoding property lists (plist) in both XML and binary formats. Property Lists are commonly used in macOS and iOS applications for storing serialized data and configuration files.
Install via npm:
npm install @remotex-labs/xplist
Or using yarn:
yarn add @remotex-labs/xplist
You can import the entire library or just the specific format functionality you need:
// Import everything
import { encodePlist, decodePlist, encodeBinary, decodeBinary } from '@remotex-labs/xplist';
// Import only XML plist functionality (5KB)
import { encodePlist, decodePlist } from '@remotex-labs/xplist/xml';
// Import only binary plist functionality (9KB)
import { encodeBinary, decodeBinary, CreateUID } from '@remotex-labs/xplist/binary';
import { encodePlist } from '@remotex-labs/xplist/xml';
// OR: import { encodePlist } from '@remotex-labs/xplist';
const data = {
name: 'John',
age: 30,
isActive: true,
createdAt: new Date(),
scores: [95, 87, 92],
metadata: {
roles: ['admin', 'user'],
settings: {
darkMode: true
}
}
};
const xmlString = encodePlist(data);
console.log(xmlString);
import { encodeBinary } from '@remotex-labs/xplist/binary';
// OR: import { encodeBinary } from '@remotex-labs/xplist';
const data = {
name: 'John',
age: 30,
isActive: true,
createdAt: new Date()
};
const binaryData = encodeBinary(data);
// Output is a Buffer containing the binary plist format
import { decodePlist } from '@remotex-labs/xplist/xml';
// OR: import { decodePlist } from '@remotex-labs/xplist';
const xmlString = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>John</string>
<key>age</key>
<integer>30</integer>
<key>isActive</key>
<true/>
<key>createdAt</key>
<date>2024-07-15T12:00:00Z</date>
</dict>
</plist>`;
const data = decodePlist(xmlString);
console.log(data);
// { name: 'John', age: 30, isActive: true, createdAt: Date(2024-07-15T12:00:00.000Z) }
import { decodeBinary } from '@remotex-labs/xplist/binary';
// OR: import { decodeBinary } from '@remotex-labs/xplist';
// Binary data as a Buffer or Uint8Array
const binaryData = Buffer.from(/* binary data here */);
const data = decodeBinary(binaryData);
console.log(data);
When using selective imports, you can significantly reduce your application's bundle size:
This library handles a wide range of data types for both encoding and decoding:
JavaScript Type | XML Plist | Binary Plist |
---|---|---|
String | <string> | String |
Number | <integer> or <real> | Integer or Real |
BigInt | <integer> | Integer |
Boolean | <true/> or <false/> | Boolean |
Date | <date> | Date |
Buffer | <data> | Data |
Array | <array> | Array |
Set | <array> | Set |
Object | <dict> | Dictionary |
null/undefined | Not supported | Not supported |
Additionally, binary plists support:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Mozilla Public License Version 2.0 - see the LICENSE file for details.
FAQs
A lightweight library for encoding and decoding property lists (plist) in both `plist` and `binary` formats.
The npm package @remotex-labs/xplist receives a total of 2 weekly downloads. As such, @remotex-labs/xplist popularity was classified as not popular.
We found that @remotex-labs/xplist demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.