Apple's property list parser/builder for Node.js and browsers
npm install plistplist.js
========

Provides facilities for reading and writing 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. They are very similar
to JSON. A valid Plist file is representable as a native JavaScript Object
and vice-versa.
Install using npm:
`` bash`
$ npm install --save plist
Then require() the _plist_ module in your file:
` js
var plist = require('plist');
// now use the parse() and build() functions`
var val = plist.parse('
console.log(val); // "Hello World!"
Include the dist/plist.js in a
`
Parsing a plist from filename:
` javascript
var fs = require('fs');
var plist = require('plist');
var obj = plist.parse(fs.readFileSync('myPlist.plist', 'utf8'));
console.log(JSON.stringify(obj));
`
Parsing a plist from string payload:
` javascript
var plist = require('plist');
var xml =
'' +
'' +
'
'
'
'
'
'
'
'
'
'
'
'
'
console.log(plist.parse(xml));
// [
// "metadata",
// {
// "bundle-identifier": "com.company.app",
// "bundle-version": "0.1.1",
// "kind": "software",
// "title": "AppName"
// }
// ]
`
Given an existing JavaScript Object, you can turn it into an XML document
that complies with the plist DTD:
` javascript
var plist = require('plist');
var json = [
"metadata",
{
"bundle-identifier": "com.company.app",
"bundle-version": "0.1.1",
"kind": "software",
"title": "AppName"
}
];
console.log(plist.build(json));
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
``
Much thanks to Sauce Labs for providing free resources that enable cross-browser testing on this project!
