diff --git a/typescript/Makefile b/typescript/Makefile index f8cb923..3e83df3 100644 --- a/typescript/Makefile +++ b/typescript/Makefile @@ -1,11 +1,10 @@ all: tsc -d r2pipe/index.ts # tsc - tsc test.ts - node test.js - tsc lo.ts - r2 -q -i lo.js /bin/ls -# r2 -q -c '#!pipe node --inspect lo.js' /bin/ls + tsc test-spawn.ts + node test-spawn.js + tsc test-local.ts + r2 -q -i test-local.js /bin/ls vs vsc: open -a "Visual Studio Code" . diff --git a/typescript/test-http.ts b/typescript/test-http.ts new file mode 100644 index 0000000..58bad6f --- /dev/null +++ b/typescript/test-http.ts @@ -0,0 +1,15 @@ +// tsc test-http.ts +// node --insecure-http-parser test-http.js + +import * as r2pipe from "./r2pipe/index.js"; +// import * as r2pipe from "r2pipe-ts"; + +async function main() { + console.log("Hello R2Pipe for TypeScript"); + const r2 = await r2pipe.open("http://127.0.0.1:9090"); + const res = await r2.cmd("?E Hello TypeScript"); + console.log(res); + await r2.quit(); +} + +main().then((x)=>{}).catch(console.error); diff --git a/typescript/lo.ts b/typescript/test-local.ts similarity index 100% rename from typescript/lo.ts rename to typescript/test-local.ts diff --git a/typescript/test.ts b/typescript/test-spawn.ts similarity index 100% rename from typescript/test.ts rename to typescript/test-spawn.ts