UNPKG

2.04 kBMarkdownView Raw
1# fast-plist [![Build Status](https://travis-ci.org/Microsoft/node-fast-plist.svg?branch=master)](https://travis-ci.org/Microsoft/node-fast-plist) [![Coverage Status](https://coveralls.io/repos/github/Microsoft/node-fast-plist/badge.svg?branch=master)](https://coveralls.io/github/Microsoft/node-fast-plist?branch=master)
2A fast PLIST parser.
3
4
5## Installing
6
7```sh
8npm install fast-plist
9```
10
11## Using
12
13```javascript
14var parse = require('fast-plist').parse;
15
16console.log(
17 parse(`
18 <?xml version="1.0" encoding="UTF-8"?>
19 <plist version="1.0">
20 <dict>
21 <key>name</key>
22 <string>Brogrammer</string>
23 <key>settings</key>
24 <dict>
25 <key>background</key>
26 <string>#1a1a1a</string>
27 <key>caret</key>
28 <string>#ecf0f1</string>
29 <key>foreground</key>
30 <string>#ecf0f1</string>
31 <key>invisibles</key>
32 <string>#F3FFB51A</string>
33 <key>lineHighlight</key>
34 <string>#2a2a2a</string>
35 </dict>
36 </dict>
37 </plist>`
38 )
39);
40/* Output:
41{
42 "name": "Brogrammer",
43 "settings": {
44 "background": "#1a1a1a",
45 "caret": "#ecf0f1",
46 "foreground": "#ecf0f1",
47 "invisibles": "#F3FFB51A",
48 "lineHighlight": "#2a2a2a"
49 }
50}
51*/
52```
53
54```javascript
55
56parse(`bad string`);
57
58/* Output:
59
60Error: Near offset 1: expected < ~~~ad string~~~
61*/
62```
63
64## Development
65
66* `npm run watch`
67* `npm run test`
68
69## Code of Conduct
70
71This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
72
73
74## License
75[MIT](https://github.com/Microsoft/node-fast-plist/blob/master/LICENSE.md)