{"id":18938,"library":"xcparse","title":"xcparse","description":"A pbxproj parser and builder for Xcode project files, currently at version 0.0.3. Uses Chevrotain for fast, spec-compliant parsing, including support for the Data type (<xx xx xx>) missing in alternatives like the Cordova xcode package. Implements a port of the Apple CFOldStylePlist parser for accurate string handling. API is experimental and subject to breaking changes. Active development, release cadence irregular. Best for TypeScript projects needing typed pbxproj manipulation without PEG.js performance overhead.","status":"active","version":"0.0.3","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","pbxproj","xcode","ios","typescript"],"install":[{"cmd":"npm install xcparse","lang":"bash","label":"npm"},{"cmd":"yarn add xcparse","lang":"bash","label":"yarn"},{"cmd":"pnpm add xcparse","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Typescript types included. Named export only.","wrong":"const { parse } = require('xcparse')","symbol":"parse","correct":"import { parse } from 'xcparse'"},{"note":"Default export is not available. Must use named import.","wrong":"import build from 'xcparse'","symbol":"build","correct":"import { build } from 'xcparse'"},{"note":"Use type import for TypeScript compilation to avoid runtime overhead.","wrong":"import { ParsedPbxproj } from 'xcparse'","symbol":"type ParsedPbxproj","correct":"import type { ParsedPbxproj } from 'xcparse'"}],"quickstart":{"code":"import { parse, build } from 'xcparse';\nimport fs from 'fs';\n\nconst pbxprojContent = fs.readFileSync('project.pbxproj', 'utf-8');\nconst parsed = parse(pbxprojContent);\nconsole.log(parsed.objects); // Access parsed objects\n\n// Modify a build setting, then rebuild\nif (parsed.objects && parsed.objects['PBXBuildFile']) {\n  // Example: add a file\n}\nconst rebuilt = build(parsed);\nfs.writeFileSync('project.pbxproj', rebuilt);","lang":"typescript","description":"Parses a .pbxproj file into a JSON representation, then rebuilds it back to a string after modification."},"warnings":[{"fix":"Pin to exact version and watch for changelog before upgrading.","message":"API is experimental and subject to breaking changes in future releases.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Use 'xcparse' in import statements.","message":"Import path is 'xcparse' not 'xctrace' (the example in the README shows 'xctrace' which is incorrect).","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Consider using xcparse only in build tools, not in browser bundles.","message":"Chevrotain fork may cause increased bundle size; the package is not tree-shakeable.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Currently no built-in UUID generation; you must supply your own for new objects.","message":"UUID generation and unist-based API are planned but not yet implemented.","severity":"deprecated","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure you're running in Node.js and use 'import fs from 'node:fs';' for modern Node versions.","cause":"Using browser environment or import without node:fs prefix.","error":"TypeError: fs.readFileSync is not a function"},{"fix":"parse returns an object directly, not a JSON string. Do not call JSON.parse on it.","cause":"Trying to JSON.parse the output of parse() that is already an object.","error":"SyntaxError: Unexpected token in JSON at position ..."},{"fix":"Run 'yarn add xcparse' or 'npm install xcparse' and double-check the import name.","cause":"Package not installed or import path typo.","error":"Error: Cannot find module 'xcparse'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}