Axel Rauschmayer on Nostr: #TypeScript: Node.js has become quite good at auto-detecting what kind of code is ...
#TypeScript: Node.js has become quite good at auto-detecting what kind of code is passed to it via CLI options or stdin—e.g. this works (type annotation is only there to demo this feature):
node -e 'const x: string = "YES"; console.log(x)'
Details:
https://nodejs.org/api/cli.html#--input-typetypePublished at
2025-03-22 11:01:57 UTCEvent JSON
{
"id": "abdaa89f6c3a179ae2553cf32cc62a7802cacc7a7690cfe3ec2d717fe4b80381",
"pubkey": "7a7a0978cc46ef7fd548fb125e51c04de7d4ca639417a21b56aa95e3711c0b38",
"created_at": 1742641317,
"kind": 1,
"tags": [
[
"t",
"typescript"
],
[
"proxy",
"https://fosstodon.org/@rauschma/114205741386045378",
"web"
],
[
"proxy",
"https://fosstodon.org/users/rauschma/statuses/114205741386045378",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://fosstodon.org/users/rauschma/statuses/114205741386045378",
"pink.momostr"
],
[
"-"
]
],
"content": "#TypeScript: Node.js has become quite good at auto-detecting what kind of code is passed to it via CLI options or stdin—e.g. this works (type annotation is only there to demo this feature):\n\nnode -e 'const x: string = \"YES\"; console.log(x)'\n\nDetails: https://nodejs.org/api/cli.html#--input-typetype",
"sig": "7242ed84b852b932519f4cd9ac07266cd6f8d878632d27b1241d4ea815dfef7400c958b1e389ac43af3e8d9cbbece9acf0b454562c38fd0b371ab498a12c76b4"
}