Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tm-plist

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tm-plist

A parser for TextMate property lists

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

TextMate Plists

A library for parsing the property list file format that is used by the TextMate code editor. TextMate uses a format that is extremely close to so called 'old-style' property lists, aka. ASCII property lists, but there are a few small differences.

The library also contains a basic object model for TextMate grammars.

API

A single function parse that takes a string and returns an object.

const tmplist = require ('tm-plist')

var sample = `{
  key1 = 1;
  key2 = 2;
  array = (4, :true, 5, 6)
}
`
console.log (tmplist.parse (sample))

File format

The partial grammar below was found in the TextMate source code here. Additional information was found in the TextMate 1 documentation here.

The last however implies that unquoted keys cannot start with leading digits even though this does happen in practice. (For example, capture names in TextMate grammar files are stored as dicts with numeric keys.)

The NeXTSTEP format allowed unquoted strings with characters in the set [a-zA-Z0-9_$+/:.\-]. This must be different from the TextMate format because TextMate uses :true and :false as booleans. This library allows unquoted strings with characters in the set [a-zA-Z0-9_$+/.\-].

array:    '(' (element ',')* (element)? ')'
dict:     '{' (key '=' value ';')* '}'
integer:  ('-'|'+')? ('0x'|'0')? [0-9]+
float:    '-'? [0-9]* '.' [0-9]+
boolean:  :true | :false
string:   ["] … ["] | ['] … ['] | [a-zA-Z_-]+
data:     <DEADBEEF>
date:     @2010-05-10 20:34:12 +0000

Licence

MIT. Enjoy!

Keywords

FAQs

Package last updated on 24 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc