DefinitelyTyped/types/temp-write/temp-write-tests.ts
2017-08-10 16:54:57 -07:00

13 lines
389 B
TypeScript

import tempWrite = require('temp-write');
tempWrite('unicorn').then(path => {
path; // $ExpectType string
});
tempWrite('unicorn', 'pony.png'); // $ExpectType Promise<string>
tempWrite(process.stdin, 'pony.png');
tempWrite(new Buffer('pony'), 'pony.png');
tempWrite.sync('unicorn'); // $ExpectType string
tempWrite.sync(new Buffer('unicorn'));
tempWrite.sync('unicorn', 'pony.png');