Ok, so I found the answer to my question.
Addy Osmani showed me where to look in this thread on twitter, and then I later found this link which shows exactly what I need.
The gist of it boils down to two functions : readFileAsString
and write
. Usage is as follows:
var path = "/path/to/file.html",
file = this.readFileAsString(path);
/* make modifications to the file string here */
this.write(path, file);
Edit: I’ve also blogged about this on my blog.
EDIT 1
As mentionned in comments by Toilal :
The
write
method doesn’t exists anymore, and must be replaced bywriteFileFromString
(arguments are also reversed) – Toilal
EDIT 2
And then, as mentionned in comments by ivoba:
this.writeFileFromString
&this.readFileAsString
are deprecated, github.com/yeoman/html-wiring should be used by now, things change 🙂 – ivoba