@plist/serialize
An universal TypeScript library for serializing Apple's Property Lists. Supports binary, text and XML plists; works well in both browser and node.
About
This library adapts logic and test cases from plist.js.
Installation
@plist/serialize is available on npm, you can install it with either npm or yarn:
npm install @plist/serialize
# or:
yarn install @plist/serialize
Usage
import { serialize } from '@plist/serialize';
import { PlistFormat } from '@plist/common';
const xml = serialize(
{
dictionary: {
hello: 'world',
},
},
PlistFormat.XML
);
/* =>
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>hello</key>
<string>world</string>
</dict>
</plist>
*/