Skip to content
TORNLIFE More

[Tool] Easily create scripts in TypeScript + more

Started by neth [3564828] Reporter on in Tools & Userscripts.

1 replies · 105 views · thread synced · 7 days ago · View on torn.com
About this thread

Posts archived: 2 / 2 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
2
Discussion span
→
People posting
1
Likes on archived posts
5
Authority score
52 / 100
Historical score
26 / 100
Story score
28 / 100
Engagement score
46 / 100
neth [3564828] Reporter

The Problem

All basic scripts starts in one massive JavaScript file that quickly turns into an unorganized mess. No type safety, no modularity, no structure. It works, but it doesn't scale, and it's painful to maintain which is why I assume a lot of scripts have been abandoned.

 

My Solution

I got tired of it, so I figured out how to write TamperMonkey scripts in TypeScript with my code neatly split across multiple files, and everything bundled into a single .user.js ready to install. But setting up that toolchain from scratch every time was its own headache. So I built a CLI tool that does it for you in seconds.

 

create-tampermonkey-typescript

 

A scaffolding tool that generates a fully configured TamperMonkey project with TypeScript, Vite, and all the boilerplate already wired up with no unnecessary additions to keep it as minimal as possible. Just run one command and start writing your script.

 

What you get:

  • Write in TypeScript with as many files as you want — everything is bundled into a single script
  • CSS injection — import .css files and they're automatically injected at runtime
  • Userscript header generated from package.json — one source of truth for name, version, description, etc.
  • Optional React support out of the box
  • Optional GitHub Actions workflows for automated tagging and releases
  • Works with npm, yarn, or pnpm

 

Get started:

npx create-tampermonkey-typescript

 

Full documentation and source on GitHub: https://github.com/neth392/create-tampermonkey-typescript

 

npm package: https://www.npmjs.com/package/create-tampermonkey-typescript

 

If you write TamperMonkey scripts for Torn and want a better & quicker dev experience, give it a shot

neth [3564828] Reporter

[RESERVED]

 

Updates

2.12.26 - v1.1.0: Had a few edge case issues which I didn't come across in testing until now when showing it to a few friends. Fixes live & pushed to 1.1.0

 

2.17.26 - v1.2.0: TailwindCSS & Prettier support added as features. Easily utilize tailwindcss for styling and the vite plugin will automatically add what you use to the output script. Prettier for automatic formatting of your code and maintaining a specific style.