Momin Ghalib
◂ PostsA tiny CLI in TypeScript1 min

A tiny CLI in TypeScript

Placeholder tutorial post, to show code blocks.

Published
Reading time
1 min
Topics
codetypescript

Placeholder introduction for a tutorial post.

Setup

Run this command to create the project:

npm init -y && npm install tsx

The code

#!/usr/bin/env tsx
const [, , name = 'world'] = process.argv;

function greet(who: string): string {
  return `Hello, ${who}!`;
}

console.log(greet(name));

Placeholder paragraph. Inline code looks like greet('you').

Next steps

  1. Add argument parsing.
  2. Add tests.
  3. Publish to npm.