GithubHelp home page GithubHelp logo

mat-sz / plist Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 1.3 MB

๐Ÿ“ An universal TypeScript library for handing Apple's Property Lists. Supports binary, text and XML plists; works well in both browser and node.

License: BSD 3-Clause Clear License

TypeScript 100.00%
apple binary parser plist property-list propertylist serializer xml ios javascript

plist's Introduction

@plist/plist

An universal TypeScript library for handing Apple's Property Lists. Supports binary, text and XML plists; works well in both browser and node.

workflow npm npm NPM

About

@plist/* adapts code, logic and test cases from:

I've decided to proceed with creating new libraries, instead of using those packages as dependencies, since it was necessary to modify the upstream code to remove reliance on node-only packages (mainly fs) and this would be too much of a change for anyone relying on the aforementioned libraries.

This library differs from other plist-related JavaScript libraries:

  • works on binary, text (OpenStep/NEXTStep), and XML plists
  • works in both node.js and browser environments (ArrayBuffer instead of Buffer, no usage of fs or other node-only libraries)

Installation

@plist/plist is available on npm, you can install it with either npm or yarn:

npm install @plist/plist
# or:
yarn install @plist/plist

Usage

import { parse, serialize } from '@plist/plist';

parse(serialize({ hello: 'world' })); // => { hello: 'world' }

Compatibility

This library relies on (relatively) new JavaScript features such as BigInt.

Therefore, without polyfills, those are the minimum browser and node/deno versions @plist/plist will work in:

Environment Version
Chrome/Chromium 67+
Edge 79+
Firefox 100+
Internet Explorer Not supported
Opera 54+
Safari 14.1+ (iOS 14.1+, macOS 11.1+)
Deno 1.0+
node.js 16.5.0+

plist's People

Contributors

mat-sz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

plist's Issues

Empty Dictionaries fail

If the file contains empty dictionaries (or empty stuff generally), like:

// !$*UTF8*$!
{
  archiveVersion = 1;
  classes = {};

The library fails with:

 throw new Error("Unexpected '".concat(char, "'"));
                ^

Error: Unexpected '}'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.