write
ts
function Barrel.write(path: string, barrel: string): Promise<void>Wrapper around fs.writeFile which:
- Trims
barreland ensures a trailing newline - Aborts mission if
barreldidn't change, helps prevent file watchers from going into infinite loops, including the ones present in modern bundlers - Pretty prints to terminals
- Runs
mkdirto create folders leading up topathas necessary