How to use the plist.parse function in plist

To help you get started, we’ve selected a few plist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electron / electron-osx-sign / util-entitlements.js View on Github external
.then(function (result) {
      entitlements = plist.parse(result)
      if (!entitlements['com.apple.security.app-sandbox']) {
        // Only automate when app sandbox enabled by user
        return
      }

      return readFileAsync(appInfoPath, 'utf8')
        .then(function (result) {
          appInfo = plist.parse(result)
          // Use ElectronTeamID in Info.plist if already specified
          if (appInfo.ElectronTeamID) {
            debuglog('`ElectronTeamID` found in `Info.plist`: ' + appInfo.ElectronTeamID)
          } else {
            // The team identifier in signing identity should not be trusted
            if (opts['provisioning-profile']) {
              appInfo.ElectronTeamID = opts['provisioning-profile'].message.Entitlements['com.apple.developer.team-identifier']
              debuglog('`ElectronTeamID` not found in `Info.plist`, use parsed from provisioning profile: ' + appInfo.ElectronTeamID)
github andris9 / mobileconfig / test / mobileconfig-unit.js View on Github external
accountDescription: 'Configure your calendar',

                dav: {
                    hostname: 'http://localhost:8080',
                    port: 8080,
                    secure: false,
                    principalurl: 'http://localhost:8080/dav/username',
                    username: 'username@gmail.com',
                    password: 'mypass'
                },

                contentUuid: 'abcdef',
                plistUuid: 'ghijklmn'
            };

            let caldavConfig = plist.parse(mobileconfig.getCalDAVConfig(options));

            expect(caldavConfig).to.deep.equal({
                PayloadContent: [
                    {
                        CalDAVAccountDescription: 'Configure your calendar',
                        CalDAVPrincipalURL: 'http://localhost:8080/dav/username',
                        CalDAVHostName: 'http://localhost:8080',
                        CalDAVPort: 8080,
                        CalDAVUseSSL: false,
                        CalDAVUsername: 'username@gmail.com',
                        CalDAVPassword: 'mypass',
                        PayloadDescription: 'username@gmail.com calendar events',
                        PayloadDisplayName: 'username@gmail.com calendar events',
                        PayloadIdentifier: 'com.my.company',
                        PayloadOrganization: 'My Company',
                        PayloadType: 'com.apple.caldav.account',
github nordnet / cordova-universal-links-plugin / hooks / lib / ios / projectEntitlements.js View on Github external
function getEntitlementsFileContent() {
  var pathToFile = pathToEntitlementsFile();
  var content;

  try {
    content = fs.readFileSync(pathToFile, 'utf8');
  } catch (err) {
    return defaultEntitlementsFile();
  }

  return plist.parse(content);
}
github j3k0 / cordova-plugin-openwith / hooks / iosRemoveTarget.js View on Github external
function projectPlistJson(context, projectName) {
  var plist = require('plist');
  var path = projectPlistPath(context, projectName);
  return plist.parse(fs.readFileSync(path, 'utf8'));
}
github z-dev / rn-scaffold / src / reactNativeConfig / xcodeProject.js View on Github external
const updateInfoPlist = (infoPlistFile, key, value) => {
  const data = plist.parse(fs.readFileSync(infoPlistFile, 'utf8'))
  fs.writeFileSync(infoPlistFile, plist.build({ ...data, [key]: value }))
}
github brandonjjon / tp-importer / src / importer.js View on Github external
plist(file) {
    let contents;

    try {
      contents = fs.readFileSync(file, 'utf-8');
    } catch(e) {
      contents = plist.build([]);
    }

    return plist.parse(contents);
  }
github chenquincy / app-info-parser / lib / ipa.js View on Github external
_parsePlist (buffer) {
    let result
    const bufferType = buffer[0]
    if (bufferType === 60 || bufferType === '<' || bufferType === 239) {
      result = parsePlist(buffer.toString())
    } else if (bufferType === 98) {
      result = parseBplist(buffer)[0]
    } else {
      throw new Error('Unknow plist buffer type.')
    }
    return result
  }
  /**
github wollardj / node-simple-plist / simple-plist.js View on Github external
function parse(aStringOrBuffer, aFile) {
  const firstByte = aStringOrBuffer[0]
  let results
  try {
    if (firstByte === 60 || firstByte === '<') {
      results = plist.parse(aStringOrBuffer.toString())
    } else if (firstByte === 98) {
      ;[results] = bplistParser.parseBuffer(aStringOrBuffer)
    } else if (aFile != null) {
      throw new Error(`Unable to determine format for '${aFile}'`)
    } else {
      throw new Error('Unable to determine format for plist aStringOrBuffer')
    }
  } catch (error) {
    throw new Error(error)
  }
  return results
}

plist

Apple's property list parser/builder for Node.js and browsers

MIT
Latest version published 1 year ago

Package Health Score

74 / 100
Full package analysis