Registry / serialization / xcparse

xcparse

JSON →
library0.0.3jsnpmunverified

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.

npm install xcparse
INSTALL
IMPORT
SIG · XCPARSE
X
xcparse
serializationjavascriptv0.0.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parse
import { parse } from 'xcparse'
const { parse } = require('xcparse')
Typescript types included. Named export only.
build
import { build } from 'xcparse'
import build from 'xcparse'
Default export is not available. Must use named import.
type ParsedPbxproj
import type { ParsedPbxproj } from 'xcparse'
import { ParsedPbxproj } from 'xcparse'
Use type import for TypeScript compilation to avoid runtime overhead.

Parses a .pbxproj file into a JSON representation, then rebuilds it back to a string after modification.

import { parse, build } from 'xcparse'; import fs from 'fs'; const pbxprojContent = fs.readFileSync('project.pbxproj', 'utf-8'); const parsed = parse(pbxprojContent); console.log(parsed.objects); // Access parsed objects // Modify a build setting, then rebuild if (parsed.objects && parsed.objects['PBXBuildFile']) { // Example: add a file } const rebuilt = build(parsed); fs.writeFileSync('project.pbxproj', rebuilt);
Debug
Known issues
breakingAPI is experimental and subject to breaking changes in future releases.
fix
Pin to exact version and watch for changelog before upgrading.
affects: >=0.0.1
gotchaImport path is 'xcparse' not 'xctrace' (the example in the README shows 'xctrace' which is incorrect).
fix
Use 'xcparse' in import statements.
affects: >=0.0.1
gotchaChevrotain fork may cause increased bundle size; the package is not tree-shakeable.
fix
Consider using xcparse only in build tools, not in browser bundles.
affects: >=0.0.1
deprecatedUUID generation and unist-based API are planned but not yet implemented.
fix
Currently no built-in UUID generation; you must supply your own for new objects.
affects: >=0.0.1
Errors
Common errors & fixes
TypeError: fs.readFileSync is not a function
Using browser environment or import without node:fs prefix.
fix
Ensure you're running in Node.js and use 'import fs from 'node:fs';' for modern Node versions.
SyntaxError: Unexpected token in JSON at position ...
Trying to JSON.parse the output of parse() that is already an object.
fix
parse returns an object directly, not a JSON string. Do not call JSON.parse on it.
Error: Cannot find module 'xcparse'
Package not installed or import path typo.
fix
Run 'yarn add xcparse' or 'npm install xcparse' and double-check the import name.
Upgrade
Version history
0.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
18
OpenAI (training)
1
Resources
xcparse — npm install xcparse · libregistry