async function testExampleString(str) {
	// str = str.replace("from \"tone\"", `from "${resolve(__dirname, "../../")}"`);
	str = `import * as Tone from "${resolve(__dirname, "../../")}"`;
	const { path, cleanup } = await file({ postfix: ".ts" });
	// work with file here in fd
	await writeFile(path, str);
	try {
		await execPromise(`tsc  --noEmit --target es5 --lib dom,ES2015 ${path}`);
	} finally {
		cleanup();
	}
}
/**
 * Run the string through the typescript compiler
 */
Run the string through the typescript compiler
Run the string through the typescript compiler
async function testExampleString(str) {
	str = `import * as Tone from "${resolve(__dirname, "../../")}"`;
	const { path, cleanup } = await file({ postfix: ".ts" });
	await writeFile(path, str);
	try {
		await execPromise(`tsc  --noEmit --target es5 --lib dom,ES2015 ${path}`);
	} finally {
		cleanup();
	}
}
async function testExampleString ( str ) { str = ` ${ resolve ( __dirname , "../../" ) } ` ; const { path , cleanup } = await file ( { postfix : ".ts" } ) ; await writeFile ( path , str ) ; try { await execPromise ( ` ${ path } ` ) ; } finally { cleanup ( ) ; } }
Run the string through the typescript compiler
Run the string through the typescript compiler
// str = str.replace("from \"tone\"", `from "${resolve(__dirname, "../../")}"`); // work with file here in fd