simple-plist
A wrapper utility for interacting with plist data.
Last updated 4 years ago by wollardj .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install simple-plist 
SYNC missed versions from official npm registry.

node-simple-plist

npm npm Travis (.com) branch

A simple API for interacting with binary and plain text plist data.

Installation

$ npm install simple-plist

Reading Data

var plist = require('simple-plist')

// Read data from a file (xml or binary) (asynchronous)
plist.readFile('/path/to/some.plist', function(err, data) {
  if (err) {
    throw err
  }
  console.log(JSON.stringify(data))
})

// Read data from a file (xml or binary) (synchronous)
var data = plist.readFileSync('/path/to/some.plist')
console.log(JSON.stringify(data))

Writing Data

var plist = require('simple-plist'),
  data = plist.readFileSync('/path/to/some.plist')

// Write data to a xml file (asynchronous)
plist.writeFile('/path/to/plaintext.plist', data, function(err) {
  if (err) {
    throw err
  }
})

// Write data to a xml file (synchronous)
plist.writeFileSync('/path/to/plaintext.plist', data)

// Write data to a binary plist file (asynchronous)
plist.writeBinaryFile('/path/to/binary.plist', data, function(err) {
  if (err) {
    throw err
  }
})

// Write data to a binary plist file (synchronous)
plist.writeBinaryFileSync('/path/to/binary.plist', data)

Mutating Plists In Memory

var plist = require('simple-plist')

// Convert a Javascript object to a plist xml string
var xml = plist.stringify({ name: 'Joe', answer: 42 })
console.log(xml) // output is a valid plist xml string

// Convert a plist xml string or a binary plist buffer to a Javascript object
var data = plist.parse(
  '<plist><dict><key>name</key><string>Joe</string></dict></plist>'
)
console.log(JSON.stringify(data))

Current Tags

  • 1.3.1                                ...           latest (4 years ago)
  • 1.4.0-0                                ...           next (4 years ago)

19 Versions

  • 1.4.0-0                                ...           4 years ago
  • 1.4.0                                ...           4 years ago
  • 1.3.1                                ...           4 years ago
  • 1.3.0                                ...           4 years ago
  • 1.2.3 [deprecated]           ...           4 years ago
  • 1.2.2 [deprecated]           ...           4 years ago
  • 1.2.1 [deprecated]           ...           4 years ago
  • 1.2.0 [deprecated]           ...           4 years ago
  • 1.1.1                                ...           6 years ago
  • 2.0.0-rc.0                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.0                                ...           7 years ago
  • 0.3.0                                ...           8 years ago
  • 0.2.1                                ...           9 years ago
  • 0.1.4                                ...           10 years ago
  • 0.0.4                                ...           11 years ago
  • 0.0.3                                ...           11 years ago
  • 0.0.2                                ...           13 years ago
  • 0.0.1                                ...           13 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 3
Dependencies (3)
Dev Dependencies (11)
Dependents (4)

Copyright 2013 - present © cnpmjs.org | Home |