A fast PLIST parser
Перейти к файлу
Alexandru Dima a030d4756d
Improve `.npmignore` (#6)
2022-11-22 17:05:49 +01: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 pipeline 2022-11-21 16:16:50 +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 v0.1.3 (#5) 2022-11-22 16:42:26 +01: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