You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
chee rabbits 5edcbee82a 0.4.1 2 years ago
code replace newlines with \n, also naïvely 2 years ago
.editorconfig add code style files and gitignore 4 years ago
.eslintrc.yaml add code style files and gitignore 4 years ago
.gitignore add code style files and gitignore 4 years ago
README.md Told @gnarf (#1) 4 years ago
index.js Add a command line interface to nextstep-plist 2 years ago
package-lock.json 0.4.1 2 years ago
package.json 0.4.1 2 years ago
tests.js Add test for unquoted dict value 3 years ago
yarn.lock Upgrade eslint dependencies 3 years ago

README.md

NeXTStep plist parser and writer

parse and generate NeXTStep style plists in node. these are not the xml style, but the older NeXTStep style (a similar filetype is used in GNUStep, with extensions)

the only place i know of to still use them in macOS is ~/Library/KeyBindings/DefaultKeyBinding.dict

the code is a messy state machine based on douglas crockford's json_parse_state

thanks everybody

using

const plist = `{
  "~f" = "moveWordForward:",
  "~b" = "moveWordBackward:"
}`
const {parse, stringify} = require('nextstep-plist')
const js = parse(plist) // {'~f': 'moveWordForward:', '~b': 'moveWordBackward:'}
stringify(js) // '{ "~f" = "moveWordForward:"; "~b": "moveWordBackward":}'

todo

  • clean up this code
  • support <binary> syntax
  • support comments
  • make the output prettier
  • write tests for stringify
  • ~tell @gnarf~