strfry-policies/entrypoint.example.ts

23 lines
369 B
TypeScript
Raw Normal View History

2023-03-24 19:36:11 +00:00
#!/bin/sh
//bin/true; exec deno run -A "$0" "$@"
import {
antiDuplicationPolicy,
hellthreadPolicy,
noopPolicy,
pipeline,
rateLimitPolicy,
readStdin,
writeStdout,
} from './mod.ts';
2023-03-24 19:36:11 +00:00
const msg = await readStdin();
const result = await pipeline(msg, [
noopPolicy,
hellthreadPolicy,
antiDuplicationPolicy,
rateLimitPolicy,
]);
writeStdout(result);