Skip to main content
Deno 2 is finally here 🎉️
Learn more

deno.land/x/bplist_parser

A Deno port for the bplist-parser NPM package. Parses macOS binary property lists into equivalent (non-binary) JavaScript values.

Usage

Parsing a bplist file from disk

import {
  parseFile,
  parseFileSync,
} from "https://deno.land/x/bplist_parser@0.1.0/mod.ts";

const bplist = "./path/to/file.bplist";
const parsed = await parseFile(bplist);

// To make the path relative to the parent folder of the currently running
// script, add `import.meta.url` as the cwd
const parsed2 = await parseFile(bplist, import.meta.url);

// The synchronous version accepts the same arguments
const parsed3 = parseFileSync(bplist, import.meta.url);

Parsing an in-memory bplist

import { parseBuffer } from "https://deno.land/x/bplist_parser@0.1.0/mod.ts";

const bplist: Uint8Array = await fetchFileSomehow(/*...*/);
const parsed = parseBuffer(data);

TODO

  • Docs describing the supported bplist data types and what they deserialize into

Changelog

  • 0.1.0 (May 30, 2022)
    • Started with node-bplist-parser@0.3.2
    • async/await
    • Inlined types
    • Deno.readFile instead of Node’s fs module
    • ArrayBufferViews instead of Node Buffers
    • Some code DRYing, notes, docs
    • Rewrote tests for Deno.test

This module was adapted from https://github.com/joeferner/node-bplist-parser. The original license can be found in that repo’s README.

All additional work is copyright 2022 Connor Logan. All rights reserved.