namespace helpers.file { /** */ export function read ( path : string ) : string { const nm_fs = require("fs"); const buffer : Buffer = nm_fs.readFileSync(path); const content : string = buffer.toString(); return content; } /** */ export function write ( path : string, content : string ) : Promise { const nm_fs = require("fs"); return ( new Promise ( (resolve, reject) => { nm_fs.writeFileSync ( path, content, (error) => { if (error) reject(error); else resolve(undefined); } ); } ) ); } }