Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Mac OS X Plist parser for NodeJS. Convert a Plist file or string into a native JS object
JavaScript
Branch: plist-builder
Pull request Compare This branch is 141 commits behind TooTallNate:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
tests
.gitignore
LICENSE
README.md
package.json

README.md

node-plist

This library contains a parser/builder for Mac OS X Plist (property list) files. These are often used in programming OS X and iOS applications, as well as the iTunes configuration XML file.

Plist files represent stored programming "object"s. This makes them very similar in nature to a JSON file. A valid Plist file should be directly representable as a native JavaScript Object and vice-versa.

Usage

Exported are parseFile, parseString and build functions. Here's some examples:

var plist = require('plist');

plist.parseFile('myPlist.plist', function(err, obj) {
  if (err) throw err;

  console.log(JSON.stringify(obj));
});

Just a String payload works as well:

var plist = require('plist');

plist.parseString('<plist><string>Hello World!</string></plist>', function(err, obj) {
  if (err) throw err;

  console.log(obj[0]);
  // Hello World!
});

Given an existing JavaScript Object, you can turn it into an XML document that complies with the plist DTD:

var plist = require('plist');

console.log(plist.build({foo : "bar"}).toString());
Something went wrong with that request. Please try again.