Skip to content

Commit cf40d6f

Browse files
committed
chore: update README.md
1 parent 8db088d commit cf40d6f

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ based on donated code from [alunny / node-xcode](https://github.com/alunny/node-
3737
## Example
3838

3939
```js
40-
// API is a bit wonky right now
41-
var xcode = require('xcode'),
42-
fs = require('fs'),
43-
projectPath = 'myproject.xcodeproj/project.pbxproj',
44-
myProj = xcode.project(projectPath);
40+
const fs = require('node:fs');
41+
const xcode = require('xcode');
4542

46-
// parsing is async, in a different process
43+
// Path to the Xcode project's project.pbxproj file.
44+
const projectPath = 'myproject.xcodeproj/project.pbxproj';
45+
// Create a PBXProject instance for the project.
46+
const myProj = xcode.project(projectPath);
47+
48+
// Parse the project file asynchronously before making changes.
4749
myProj.parse(function (err) {
4850
myProj.addHeaderFile('foo.h');
4951
myProj.addSourceFile('foo.m');
5052
myProj.addFramework('FooKit.framework');
5153

54+
// Write the updated project back to disk.
5255
fs.writeFileSync(projectPath, myProj.writeSync());
53-
console.log('new project written');
56+
57+
console.log('New project written');
5458
});
5559
```
56-
57-
## License
58-
59-
Apache V2

0 commit comments

Comments
 (0)