open-index/open-npm huggingface dataset:
npm package: @parseaple/bplist
Description: Binary plist parser for Node.js
Author: qwerzl
Latest version: 1.0.1

# @parseaple/bplist

A TypeScript parser for Apple's binary property list (bplist) format.

Based on [node-bplist-parser](https://github.com/joeferner/node-bplist-parser) by Joe Ferner.

Many thanks to Joe Ferner for the original implementation.

[![CI](https://github.com/photon-ai/parseaple/workflows/CI/badge.svg)](https://github.com/photon-ai/parseaple/actions)
[![npm version](https://img.shields.io/npm/v/@parseaple/bplist)](https://www.npmjs.com/package/@parseaple/bplist)
[![license](https://img.shields.io/npm/l/@parseaple/bplist)](./LICENSE)

## What is bplist?

Binary property list (bplist) is a compact binary serialization format used by Apple for storing structured data. It's commonly found in macOS and iOS system files, application preferences, `Info.plist` files, and various other configuration files. Binary plists are more efficient than their XML counterparts and support additional data types like dates, binary data, and UID references.

## Installation

```
npm install @parseaple/bplist
```

## Usage

### Parse a file

```js
import * as bplist from "@parseaple/bplist";

const [data] = await bplist.parseFile("Info.plist");
console.log(data);
```

### Parse synchronously

```js
import * as bplist from "@parseaple/bplist";

const [data] = bplist.parseFileSync("Info.plist");
console.log(data);
```

### Parse from buffer

```js
import * as bplist from "@parseaple/bplist";
import { readFileSync } from "node:fs";

const buffer = readFileSync("myPlist.bplist");
const [data] = bplist.parseBuffer(buffer);
console.log(data);
```

### Legacy callback style

```js
import { parseFile } from "@parseaple/bplist";

parseFile("myPlist.bplist", (err, data) => {
  if (err) throw err;
  console.log(data);
});
```

## Supported types

The library supports all standard binary plist types:

- Null (`null`)
- Boolean (`true`, `false`)
- Integer (including 64-bit `bigint`)
- Real (floating-point numbers)
- Date (`Date` objects)
- Data (`Buffer` objects)
- ASCII String and UTF-16 String (`string`)
- UID (represented as `{ UID: number }`)
- Array (`Array`)
- Dictionary (`Object`)

## Development

```
bun install
bun run build
bun run test
```

## License

MIT
npm package: @parseaple/typedstream
Description: A TypeScript parser for Apple's typedstream/NSArchiver binary format
Author: qwerzl
Latest version: 2.0.1

# @parseaple/typedstream

A TypeScript parser for Apple's typedstream/NSArchiver binary format.

Based on [node-typedstream](https://github.com/BlueBubblesApp/node-typedstream) and [python-typedstream](https://github.com/dgelessus/python-typedstream).

Many thanks to Elliot Nash, this package is largely based on their prior effort in [node-typedstream](https://github.com/BlueBubblesApp/node-typedstream).

[![CI](https://github.com/photon-ai/parseaple/workflows/CI/badge.svg)](https://github.com/photon-ai/parseaple/actions)
[![npm version](https://img.shields.io/npm/v/@parseaple/typedstream)](https://www.npmjs.com/package/@parseaple/typedstream)
[![license](https://img.shields.io/npm/l/@parseaple/typedstream)](./LICENSE)

## What is typedstream?

`typedstream` is a binary serialization format used by Apple's `NSArchiver` / `NSUnarchiver` classes (the predecessor to `NSKeyedArchiver`). It appears in various macOS and iOS files, including `.clr` (color palettes), `.gcx` (Grapher documents), and other legacy archive formats.

## Installation

```
npm install @parseaple/typedstream
```

## Usage

### Decode a single root object

```js
import { Unarchiver } from "@parseaple/typedstream";
import { readFileSync } from "node:fs";

const data = readFileSync("path/to/file.clr");
const root = Unarchiver.open(data).decodeSingleRoot();
console.log(root);
```

### Decode all root values

```js
import { Unarchiver } from "@parseaple/typedstream";
import { readFileSync } from "node:fs";

const data = readFileSync("path/to/archive");
const values = Unarchiver.open(data).decodeAll();
console.log(values);
```

### Low-level stream reading

```js
import { TypedStreamReader } from "@parseaple/typedstream";
import { readFileSync } from "node:fs";

const data = readFileSync("path/to/archive");
const reader = new TypedStreamReader(data);

for (const event of reader) {
  console.log(event);
}
```

## Supported types

The library includes built-in support for common Foundation types:

- `NSString` / `NSMutableString`
- `NSData` / `NSMutableData`
- `NSArray` / `NSMutableArray`
- `NSDictionary` / `NSMutableDictionary`
- `NSAttributedString` / `NSMutableAttributedString`
- `NSColor`
- `NSFont`
- Common C structs (`NSPoint`, `NSSize`, `NSRect`, `CGPoint`, `CGSize`, `CGRect`)

Objects with unrecognized class names are decoded as `GenericArchivedObject` instances, preserving their full contents for inspection.

Binary property list (bplist) archives are also supported as a fallback format.

## Development

```
bun install
bun run build
bun run test
```

## License

MIT