What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-25 02:42:08
typescript compile string to js
// compile.ts import * as ts from "typescript"; function tsCompile(source: string, options: ts.TranspileOptions = null): string { // Default options -- you could also perform a merge, or use the project tsconfig.json if (null === optio... Add solution -
Shell/Bash 2021-10-12 17:53:09
install typescript in node project
// Follow the below steps and you good to go easily // create a new folder and open a terminal on that folder and type below commands npm init-y yarn add -D @types/node typescript ts-node npx tsconfig.json // open package.json and ... Add solution -
Javascript 2021-10-12 11:27:07
read json file in typescript
// data.json: { "greeting" : "xin chao Vietnam" } // component: import * as data from 'data.json'; let greeting = data.greeting; //registering jsonModule in tsconfig.json "compilerOptions": { .... "resolveJsonMod... Add solution