Skip to content

Commit

Permalink
docs: Add example for hashbang with local tsx (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Apr 12, 2024
1 parent 4886c82 commit b343b4a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,15 @@ $ ./file.ts hello
argv: [ 'hello' ]
```

If you prefer to use a local `tsx` instead of the global one, you can use `npx`:

_file.ts_
```ts
#!/usr/bin/env npx tsx

console.log('argv:', process.argv.slice(2))
```

### VS Code debugging

#### Setup
Expand Down

0 comments on commit b343b4a

Please sign in to comment.