A fast PLIST parser
Перейти к файлу
Alexandru Dima c1fe56465c
Merge pull request #9 from microsoft/dependabot/npm_and_yarn/braces-3.0.3
Bump braces from 3.0.2 to 3.0.3
2024-06-18 17:22:36 +02:00
.github/workflows Add CI 2021-11-26 11:02:50 +01:00
.vscode update deps 2022-11-21 16:15:10 +01:00
build Add `batch:true` to pipeline (#7) 2023-03-02 14:23:16 +01:00
src CRLF -> LF 2022-02-04 14:12:06 +01:00
test CRLF -> LF 2022-02-04 14:12:06 +01:00
.gitattributes CRLF -> LF 2022-02-04 14:12:06 +01:00
.gitignore CRLF -> LF 2022-02-04 14:12:06 +01:00
.npmignore Improve `.npmignore` (#6) 2022-11-22 17:05:49 +01:00
LICENSE.md CRLF -> LF 2022-02-04 14:12:06 +01:00
README.md Remove travis 2019-05-09 15:20:41 +02:00
SECURITY.md Add SECURITY.md 2021-03-10 15:05:38 +01:00
ThirdPartyNotices.txt CRLF -> LF 2022-02-04 14:12:06 +01:00
package-lock.json Bump braces from 3.0.2 to 3.0.3 2024-06-16 13:12:49 +00:00
package.json v0.1.3 (#5) 2022-11-22 16:42:26 +01:00
tsconfig.json CRLF -> LF 2022-02-04 14:12:06 +01:00

README.md

fast-plist Build Status

A fast PLIST parser.

Installing

npm install fast-plist

Using

var parse = require('fast-plist').parse;

console.log(
    parse(`
        <?xml version="1.0" encoding="UTF-8"?>
        <plist version="1.0">
        <dict>
            <key>name</key>
            <string>Brogrammer</string>
            <key>settings</key>
            <dict>
                <key>background</key>
                <string>#1a1a1a</string>
                <key>caret</key>
                <string>#ecf0f1</string>
                <key>foreground</key>
                <string>#ecf0f1</string>
                <key>invisibles</key>
                <string>#F3FFB51A</string>
                <key>lineHighlight</key>
                <string>#2a2a2a</string>
            </dict>
        </dict>
        </plist>`
    )
);
/* Output:
{
        "name": "Brogrammer",
        "settings": {
                "background": "#1a1a1a",
                "caret": "#ecf0f1",
                "foreground": "#ecf0f1",
                "invisibles": "#F3FFB51A",
                "lineHighlight": "#2a2a2a"
        }
}
*/

parse(`bad string`);

/* Output:

Error: Near offset 1: expected < ~~~ad string~~~
*/

Development

  • npm run watch
  • npm run test

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

License

MIT