Skip to content

Commit ddbad7d

Browse files
committed
example in README
1 parent 32f65ec commit ddbad7d

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# node-xcode
22

3-
> parser for xcodeproj/project.pbxproj files
3+
> parser/toolkit for xcodeproj project files
44
5-
Not much to see yet
5+
Allows you to edit xcodeproject files and write them back out.
6+
7+
## Example
8+
9+
// API is a bit wonky right now
10+
var xcode = require('xcode'),
11+
fs = require('fs'),
12+
projectPath = 'myproject.xcodeproj/project.pbxproj',
13+
myProj = xcode.project(projectPath);
14+
15+
// parsing is async, in a different process
16+
myProj.parse(function (err) {
17+
myProj.addHeaderFile('foo.h');
18+
myProj.addSourceFile('foo.m');
19+
myProj.addFramework('FooKit.framework');
20+
21+
fs.writeFileSync(projectPath, myProj.writeSync());
22+
console.log('new project written');
23+
});
24+
25+
## License
26+
27+
MIT

0 commit comments

Comments
 (0)