r/typescript • • 24d ago

Monthly Hiring Thread Who's hiring Typescript developers November

19 Upvotes

The monthly thread for people to post openings at their companies.

* Please state the job location and include the keywords REMOTE, INTERNS and/or VISA when the corresponding sort of candidate is welcome. When remote work is not an option, include ONSITE.

* Please only post if you personally are part of the hiring company—no recruiting firms or job boards **Please report recruiters or job boards**.

* Only one post per company.

* If it isn't a household name, explain what your company does. Sell it.

* Please add the company email that applications should be sent to, or the companies application web form/job posting (needless to say this should be on the company website, not a third party site).

Commenters: please don't reply to job posts to complain about something. It's off topic here.

Readers: please only email if you are personally interested in the job.

Posting BS top level comments that aren't job postings, eg "It's quiet in here" etc is a ban.


r/typescript • • 11h ago

Using readonly on a type's field to allow to implement it via a getter?

0 Upvotes

Disclaimer: I got this answer from an AI, which I haven't used before. It doesn't show its sources. I've got no idea if it's a legitimate option or a hallucination.

I asked it how to declare a getter within a type. It gave me the answer and suggested using readonly as an alternative.

I mean, it doesn't make much of a difference, in that it just makes a shorter syntax for when the getter just needs to return a simple variable without doing anything to it.

Is this a valid use?

Would the readonly field be able to be implemented via an actual getter, or does it mean that it could be a function?


r/typescript • • 22h ago

How do you keep feature modules from reaching into each other's internals in a backend?

3 Upvotes

In most backends I've worked on, "modules" are just folders. Nothing stops billing from importing a repository straight out of users, and after a while every feature quietly depends on every other feature's internals.

I'm trying a different approach in Elpod, a small framework I'm building on top of Elysia. It runs on Bun rather than Node, but the problem is the same. Each feature is a plain value that says what it owns and what it exposes:

```ts
export const users = pod({
name: "users",
prefix: "/users",
controller: UsersController,
providers: [UsersService, UsersRepository],
exports: [UsersService],
});

export const billing = pod({
name: "billing",
prefix: "/billing",
controller: BillingController,
imports: [users],
providers: [BillingService],
});
```

And a class lists what it needs as a static tuple, no decorators:

```ts
export class BillingService {
static readonly needs = [UsersService] as const;

constructor(private readonly users: UsersService) {}
}
```

Only what users exports is visible to billing, so UsersRepository stays private. Import cycles between features and duplicate exports fail when the app composes, not later. These are in-process boundaries though, not security boundaries, so authorization still lives in the services.

For those of you with bigger Node services: do you enforce this kind of thing at all? dependency-cruiser, eslint-plugin-boundaries, Nx module boundaries, or just code review? I'm curious whether doing it at the DI level feels useful or like extra ceremony.

It's alpha (0.1.x), so the API can still change. Docs if you want to look: https://elpod.vercel.app/docs/features-and-pods/


r/typescript • • 3d ago

How would you type-check a DI dependency list against the constructor params?

6 Upvotes

I'm building a small DI layer for Elysia on Bun with no decorators. A class lists its dependencies like this:

class Greeter {
  static readonly needs = [Clock] as const;
  constructor(private clock: Clock) {}
}

Right now it only checks at boot that the list length matches the constructor's parameter count. Someone on r/bun pointed out that swapping Clock for a different class with the same arity slips through, and they're right.

My plan is to map needs to instance types and compare that against ConstructorParameters<typeof Greeter>, then add a @ts-expect-error test for the swap. Has anyone done this cleanly without the error messages turning into a wall of generics?

(Project is Elpod, early alpha, if anyone's curious: https://elpod.vercel.app)


r/typescript • • 4d ago

Polylint, now supporting TSRS

0 Upvotes

I maintain Polylint source, which we use at Xberg to run linting and formating across multiple language ecosystems.

In the last version, I added support for the new tsrs engine (the Rust rewrite of the TS compiler now maintained by the OXC team). This is pretty cool - it allows adding type checking as part of the linting, and doing enhanced linting with type checking. Polylint includes oxc and combines it with our very own skif to give robust linting for JS/TS based projects. It now also supports ultra-fast type checking and incremental type checking via git hooks (per file, rather than the entire project).

Check it out:

Polylint source · tsrs integration design

Cheers.


r/typescript • • 4d ago

Codex Generated JavaScript and TypeScript Files Can Be Painful To Read. Use Airbnb JavaScript Style Guide.

0 Upvotes

Airbnb JavaScript style guide can significantly make your code better and readable by humans. In my last post I mentioned about setting up Codex Cloud and increasing my output per unit time.


r/typescript • • 6d ago

vercel-labs/scriptc: TypeScript-to-Native Compiler

Thumbnail
github.com
70 Upvotes

Vercel Labs has released scriptc, an experimental Apache 2.0 licensed compiler that turns ordinary TypeScript into small native executables with no Node, V8 and no JavaScript engine in the binary.

The repository was created on 22 July 2026 and has since gathered around 4.9k stars. scriptc uses the real TypeScript compiler for parsing and type checking, lowers programs to a typed IR, then emits readable C, LLVM IR, assembly, objects, native executables or WebAssembly via WASI Preview 1.

Every construct lands in one of three tiers: compiled statically by default, run dynamically inside an embedded quickjs-ng engine of roughly 620KB when --dynamic is passed for npm packages and any typed code, or rejected at compile time with an SC code and a rewrite hint.

A benchmark of scriptc 0.0.16 against Bun 1.3.12 and Node 24.18.0 recorded median CLI startup of 1.78ms versus 21.29ms for Bun and 61.78ms for Node, with idle memory of 1.9MiB for a framework free node:http server. The same tests found Hono required --dynamic, pushing 62% of the server into QuickJS and cutting throughput to 18.4k requests per second against Bun's 70.5k.


r/typescript • • 6d ago

Optique 1.4.0: Default commands, Markdown references, and more focused help

Thumbnail
github.com
2 Upvotes

r/typescript • • 6d ago

Why You Should Use veloxTube

0 Upvotes

Remember clicking on YouTube just to watch one specific clip, and twenty minutes later you're staring at a row of vertical brainrot about some guy building a pool out of mud? It's obnoxious. You open the app for a tutorial or a specific creator, and the algorithm instantly dumps a mountain of algorithmic garbage right in your face. Shorts shelves, comments arguing about nothing, recommended videos screaming for your attention and many more things that are not necessary.

I got tired of it and built something to strip all that noise away. It’s a tiny Firefox extension that doesn't track anything or phone home. You click the popup, check a few boxes to kill the home feed, hide the comments, zap the shorts, and banish the related videos column, and suddenly YouTube turns into a quiet, boring video player again. You search for what you actually need, watch it, and close the tab without getting sucked into a rabbit hole. It won't change your life, but it stops a website from hijacking your afternoon.

You can check github repo: https://github.com/smartestnerdfromtown/veloxtube
You can check extension itself: addons.mozilla.org/en-GB/firefox/addon/veloxtube/


r/typescript • • 7d ago

Any TypeScript ORM that supports different databases (no raw SQL/query builders this time) at the same time?

10 Upvotes

So, I am building a real estate application in Express for college.

I want to have a PostgreSQL database as the main database and the SQLite database for unit testing. For example, I made a service for the User model and I want to use it both for the web app and testing. I need a TypeScript ORM that supports multiple datasources (PostgreSQL and SQLite (in-memory if possible)). services/UserService.ts:

import { compareSync, hashSync } from "bcrypt";

import logger from "../global/logger";
import logMessages from "../global/logMessages";
import { userMapper as mapper } from "../mappers";
import { User } from "../models";
import { IRegister, IUserChangePassword, IUserUpdate } from "../interfaces";
import prisma from "../prisma/main/client";

export default class UserService {
    constructor(private prisma: any) {}

    // Main
    async create(data: IRegister) {
        delete data.password2;
        data.email = data.email.toLowerCase();
        data.password = hashSync(data.password, 10);

        // 1 Parametrized queries
        const user = await prisma.user.create({ data });

        // 5 Security logging
        logger.info(logMessages.USER_SERV.create, { userId: user.id });
        return mapper.toClass(user);
    }

    // ... other methods
}

I used to use Prisma, but setting it to support both PostgreSQL and SQLite was so convoluted. I had to build a schema, a config and a client for each datasource. That also implied having to duplicate the entire services just for unit testing.

Configurations `prisma/main/prisma,config.ts` and `prisma/test/prisma.config.ts`:
```TS
import "dotenv/config";
import { defineConfig, env } from "prisma/config";

export default defineConfig({
    schema: "./schema.prisma",
    migrations: { path: "./migrations" },
    datasource: { url: env("MAIN_DATABASE_URL") }
});
// same as above

export default defineConfig({
    // same as above
    datasource: { url: env("TEST_DATABASE_URL") }
});

prisma/main/client.ts and prisma/test/client.ts:

import { PrismaPg } from "@prisma/adapter-pg";

import { PrismaClient } from "./generated/client";
import { MAIN_DATABASE_URL } from "../../global/env";

const connectionString = MAIN_DATABASE_URL;

const adapter = new PrismaPg({ connectionString });
const client = new PrismaClient({ adapter });
export default client;

import { PrismaBetterSqlite3 } from "@prisma/adapter-better-sqlite3";

import { PrismaClient } from "./generated/client";
import { TEST_DATABASE_URL } from "../../global/env";

const connectionString = TEST_DATABASE_URL;

const adapter = new PrismaBetterSqlite3({ url: connectionString });
const client = new PrismaClient({ adapter });

export default client;

So, I turned the service into a class that will accept any client in the constructor.

export default class UserService {
    constructor(private prisma: any) {}

And I instantiated it in controllers/auth.controller.ts and tests/userService.test.ts:

// ... other imports
import { mainClient } from "../prisma";
import { UserService } from "../services";

const service = new UserService(mainClient);
import { testClient } from "../prisma";
import { UserService } from "../services";

const service = new UserService(client);

I tried Drizzle ORM with PGLite, but I did not know how to set it up for both main db and testing.

I need something simple like its in Django and Laravel. Please don't recommend raw SQL and query builders (Kysely (I hate that name) and others) at the moment.


r/typescript • • 8d ago

Seeking feedback on my niche TS code review tool(PRSense)

2 Upvotes

Hi r/typescript!

Long time lurker here. I've been a javascript dev for almost 10 years now, and moved to TypeScript a couple of years ago for serious work. Coming from an OCaml background the logical choice would've been to switch to rescript but somehow I ended up loving TypeScript for its simplicity and elegance, and much needed algebraic types. I did some serious Java coding earlier, so it would appear that I've come full circle, as TS seems like the most compact yet really powerful Java-esque language.
I've used TS in projects small and large, and couldn't go back. As of recently I've been using LLMs to generate a lot of TS code so to accelerate my workflow while maintaining my sanity. To delve deeper into the typescript ecosystem, I built https://github.com/navxio/PRSense and my productivity spiked immediately. Now I can use LLM generated code in my small to medium sized projects without headaches, and at least one of them is live with non trivial revenue(6 months in production). Needless to say it's an indispensable part of my workflow now.

It's a tiny yet powerful command line tool that integrates with git so you can use it with your agents too if you're so inclined. Looking for some devs who still write code by hand (and use LLM generated code). Any feedback is appreciated!

Thanks for reading and cheers!

Edit 1: Grammar Edit 2: It uses ts-morph aggressively to reduce LLM token budget, essentially minimizing the token usage. More on the architecture to follow in a blog post!!


r/typescript • • 7d ago

skif 0.9 replaces knip, sherif, and syncpack with one Rust binary

0 Upvotes

Hi people,

I'm glad to announce skif 0.9.0. It's a dependency linter and dead-code analysis tool for JavaScript and TypeScript monorepos, written in Rust. One binary and one skif.toml cover what knip, sherif, and syncpack check, and on the repositories where knip produces a report it runs the dead-code analysis 4 to 8 times faster than knip. It's available through npm (@polylint/skif), Cargo (skif-cli), Homebrew, Scoop, a GitHub Action, and pre-commit (see the installation instructions for details). The tool covers the following parts of dependency hygiene:

  • Manifest and workspace rules. Root private and packageManager, sorted and empty dependency maps, @types in dependencies, unmatched workspace patterns, stray lockfiles, nested workspace roots. This is the job sherif does, and skif began as a fork of it. Rules
  • Version policy. Version and semver-range groups, banned dependencies, dependency families, the workspace: protocol, catalogs (pnpm, Bun, Yarn 4.10+), and toolchain pins across packageManager, engines, .nvmrc, Dockerfiles, and workflows. This is syncpack's job, and skif vendors syncpack's specifier model. Comparison
  • Dead-code analysis. Unused files, exports, types, enum, namespace and class members; unused and unlisted dependencies, unlisted binaries, unresolved imports, duplicate exports, circular imports. It parses with oxc, reads Vue, Svelte, Astro, MDX and Marko files, and ships 213 plugins that read the configuration of common tools. Every issue type of knip 6.45 has a skif rule.
  • No project code is run while linting. Tool configurations are read statically, so a vite.config.ts that only loads inside the repository's own build does not break the run. A package whose configuration skif cannot read is listed as incomplete in the report.
  • Fixes and adoption. Safe and unsafe fix levels, --fix --dry-run diffs, format-preserving edits, and a baseline that can only shrink. skif migrate translates an existing sherif, syncpack, and knip setup into a skif.toml in one step. Migrating
  • CI, editors, and agents. Human, JSON, TOON, SARIF, GitHub annotations, GitLab Code Quality, Markdown and CODEOWNERS reports, watch mode, a language server, an MCP server, and a library API in Rust and in the npm package. Integrations

What is new in 0.9.0

Two changes matter to a user. Both are breaking, and the changelog has the full list.

  • The disk cache is on by default. skif keeps the parse result of every source file between runs, below node_modules/.cache/skif or the per-user cache directory, so a second run parses only the files that changed. It never changes a report. --no-cache, SKIF_CACHE=0 or [cache] enabled = false turns it off, skif cache stats and skif cache clean inspect and remove it, and the GitHub Action restores and saves it through its cache input.
  • Type-aware analysis is removed. It was an opt-in mode that ran a TypeScript checker for one rule, unused-class-members. I measured it before deciding: a typed run cost 1.3x to 16x the untyped run, and on the seeded dead-code benchmark it was less precise, 81% precision against 100% without types, for a recall gain of 86% against 79%. So it is gone, and every rule behaves as it did with types off, which was the default. The reasoning is in ADR 0010.

Tool comparisons

skif is of course not the only tool in this space. It stands on the three it replaces: it started as a fork of sherif, vendors parts of syncpack, and follows knip's issue types and plugin knowledge. The comparison below is against sherif 1.13.0, syncpack 15.3.3, and knip 6.45.1, checked against their source at those release tags. I did my best to ensure it's fair and comprehensive, but of course I might have missed something.

Ecosystem Location

ToolPrimary jobRuntimeRelation to skif
skifManifest rules, version policy, and dead-code analysis in one runNative binary, or a Node addon through npm—
sherifZero-config monorepo manifest rulesNative binaryskif began as a fork; the manifest rules are ported with stable ids
syncpackVersion consistency, semver ranges, catalogsNative binarySame problem space; skif reuses its specifier model
knipUnused files, exports, and dependenciesNode.jsSame problem space; skif runs on oxc and reads configuration statically

GitHub · Quick start · Benchmarks and methodology

Detailed feature matrices

✓ means the tool has the capability. ~ means narrower support, with the limit named in the cell. — means it does not. The full matrices, with numbered notes and links to the sources of each cell, are in the comparison guide.

Manifests, versions, and workspaces

Featureskifsherifsyncpackknip
Manifest and workspace rules✓✓~ sorts dependency maps only—
Version mismatches across packages✓✓ semver specifiers in dependencies and devDependencies✓—
Version groups and semver-range groups✓—✓—
Banned dependencies✓—✓—
Related dependencies on one version✓ configurable families~ fixed list of ten, within each package.json✓—
Catalog policy✓ pnpm, Bun, Yarn 4.10+—~ pnpm and Bun—
Unused catalog entries, unresolved catalog: references✓ unused entries are opt-in—~ unresolved references only✓
workspace: protocol for workspace packages✓—~ through a pinned version group—
Peer ranges the installed dev version does not satisfy✓—~ compares declared ranges—
Toolchain pins across files✓~ presence of packageManager only~ package.json fields only—
Another package manager's commands in Dockerfiles, workflows, scripts✓———
package.json formatting✓~ sorts dependency maps✓—
Newer published versions from the registry✓ skif update—✓ syncpack update—

JavaScript and TypeScript analysis

Featureskifknip
Unused and unlisted dependencies, unlisted binaries, unresolved imports✓✓
Unused files, exports, and exported types✓✓
Unused enum and namespace members✓✓
Unused class members✓ matched by name— dropped in knip 6
Duplicate exports✓✓
Circular imports✓ off by default✓ not reported by default
Test-runner mocks of modules that do not exist✓—
Why a file, export, or dependency counts as used✓ skif explain-usage✓ --trace-*
Production and strict modes✓✓
Custom compilers for other file types~ declared import patterns, never a function✓
Built-in plugins for tools and frameworks213207
Runs no project code while linting✓— loads configuration files with jiti

Fixing, adoption, and integrations

Featureskifsherifsyncpackknip
Autofix✓✓✓✓
Safe and unsafe fix levels✓——~ file deletion is opt-in
Preview fixes as a diff✓—~ lists changes, no diff—
Baseline that can only shrink✓———
Configuration translated from the other tools✓ skif migrate———
Configuration layered across directories✓——~ one file with a workspaces map
SARIF✓——✓
Language server✓——✓
MCP server✓——✓
Editor extension———✓
Custom reporters and preprocessors———✓
GitHub Action✓✓——
Library API✓ Rust crate and npm package——~ undocumented

Benchmark results

Every number below comes from one run of the bench workflow on the 0.9.0 code: GitHub Actions run 44151292705, measured on 2026-11-17.

skif0.9.0 at commit 69850aeed43d, built with rustc 1.100.0
Compared toolsknip 6.45.1, sherif 1.13.0, syncpack 15.3.3
RunnerGitHub-hosted ubuntu-24.04, image ubuntu24 20261111.127.1
MachineUbuntu 24.04.5 LTS, Linux 7.0.0-1014-aws, x86_64, Intel Xeon 6975P-C, 4 logical CPUs (2 physical cores), 15.3 GiB memory, KVM
Load average5.71 / 3.16 / 1.64 before, 2.97 / 2.56 / 2.01 after
Node and package managersNode v26.13.0, npm 11.20.0, pnpm 11.24.0, yarn 1.22.22
Timerhyperfine 1.20.0, 3 warmup runs and 15 measured runs; 1 and 5 on angular, vscode, n8n, and next-js

The method in brief. hyperfine times whole command-line invocations, process start-up included, without a shell. Times are wall clock on a warm file cache, and the tables show medians. The ratio columns are the ones the run summary prints, which is hyperfine's ratio of the means. Each compared row runs on the scope its comparison tool reads: a full skif run against knip, and skif --no-js, which runs only the manifest and policy rules, against sherif and syncpack. Every compared skif row runs with --no-cache. The repositories are pinned to a full commit SHA and their dependencies are installed first, since knip needs them. On npm-cli knip runs with --no-gitignore, since npm's .gitignore otherwise hides every workspace from it. On angular, vscode, n8n, and next-js both tools get the configuration of the agreement comparison, so they read the same files. It's a shared virtual machine, so read the ratios, which share the machine and its noise, rather than the absolute times.

Dead-code analysis: skif against knip

Repositoryskif, medianknip, medianknip / skif
create-t3-turbo28.1 msfails—
vue-core63.3 msfails—
tanstack-query359 ms2869 ms8.0x
babel807 ms4441 ms5.5x
npm-cli82.6 ms539 ms6.5x
angular857 ms3452 ms4.1x
vscode2566 ms12924 ms5.1x
n8n5079 ms21703 ms4.3x
next-js795 ms4695 ms5.9x

skif was 4.1x to 8.0x faster on the seven repositories where knip prints a report. The target I set for the project is at least 5x faster than knip on the same tree, and this run missed it on two repositories: angular at 4.1x and n8n at 4.3x. It passed on the other five.

knip exited with an error in every run on create-t3-turbo (its Expo Metro config needs metro-cache, which pnpm's strict install does not provide) and on vue-core (its SFC playground Vite config reads a build-time global that only the repository's own build defines), so there is nothing to compare there. On n8n and next-js knip exits with an error after printing its report, because two Vite configs and the root Jest config do not load outside the repositories' own builds. Its time there is that of a run without the entries of those configurations.

Three of the repositories hold nested projects that are not workspace members. skif --recursive lints them too, and no comparison tool reads them, so those rows have no ratio: 812 ms on babel, 4067 ms on vscode, 2440 ms on next-js.

Manifest and policy checks: skif --no-js against sherif and syncpack

Targetskif --no-jssherifsherif / skifsyncpack lintsyncpack / skif
Generated, 50 packages3.9 ms24.9 ms6.4x31.8 ms7.9x
Generated, 500 packages19.0 ms38.2 ms2.0x115 ms6.0x
Generated, 2000 packages82.2 ms93.7 ms1.1x512 ms6.1x
create-t3-turbo2.9 ms23.4 ms7.9x27.2 ms9.2x
vue-core3.1 ms23.9 ms7.5x28.5 ms9.1x
tanstack-query7.9 ms27.9 ms3.5x77.3 ms9.9x
babel8.3 ms25.2 ms3.1x186 ms22.5x
npm-cli4.8 ms24.6 ms5.1x50.1 ms10.4x
angular5.0 ms25.1 ms5.1x63.2 ms12.5x
vscode34.3 ms27.4 ms0.8x99.7 ms2.9x
n8n82.2 ms29.4 ms0.4x137 ms1.7x
next-js57.9 ms25.5 ms0.4x242 ms4.2x

skif was faster than syncpack on all twelve targets, from 1.7x to 22.5x. Against sherif it was faster on nine and slower on three: vscode, n8n, and next-js, where sherif finished in under 30 ms and skif took 34 to 82 ms. The target for these rules, under 50 ms on 500 packages, passed at 19.0 ms.

Module graph and peak memory

The graph target is a generated workspace of 10,000 TypeScript files in 100 packages. A whole skif run on it, every JS rule included, took 204 ms against a target of under 2 s. Peak resident set size is measured for skif only, on the full run. The run does not measure the other tools' memory, so this is not a comparison.

Targetskif, peak RSS
graph: 10,000 files in 100 packages109 MiB
create-t3-turbo26 MiB
vue-core33 MiB
tanstack-query108 MiB
babel154 MiB
npm-cli45 MiB
angular215 MiB
vscode440 MiB
n8n844 MiB
next-js187 MiB

Warm cache

This is skif against itself: the same full run, once with --no-cache and once on the store a previous run of the same tree wrote. It is compared with no other tool and enters none of the ratios above.

Targetskif, uncachedskif, warm cacheSpeed-up
graph: 10,000 files in 100 packages204 ms197 ms1.0x
create-t3-turbo28.1 ms28.0 ms1.0x
vue-core63.3 ms41.8 ms1.5x
tanstack-query359 ms317 ms1.1x
babel807 ms797 ms1.0x
npm-cli82.6 ms56.0 ms1.5x
angular857 ms409 ms2.1x
vscode2566 ms1377 ms1.9x
n8n5079 ms3892 ms1.3x
next-js795 ms610 ms1.3x

The cache saves between nothing and half of a run, 1.0x to 2.1x. Parsing is only part of the work. Reading and hashing every file, the configuration, the manifests, the module graph, and the rules still run on a warm store. The same workflow also compares the report of a cached run with the report of an uncached run on every corpus repository, across seeded source edits, and fails on any difference. In this run, 66 comparisons were identical and none differed.

Precision on seeded dead code

Real repositories have no answer key, so precision is measured on a generated 5-package workspace with 73 seeded findings next to live code that is reached only through patterns that caused false findings on real repositories. This was measured with skif 0.8.0 (commit 4d3bdd7f) without types, which is how 0.9.0 behaves, against knip 6.45.1.

ToolPrecisionRecallPrecision, 33 non-member findingsRecall, 33 non-member findings
skif100%79%100%100%
knip74%59%69%100%

skif reported no live code as dead. The recall it lacks is in members: it matches member reads by name, so it found 15 of 20 seeded unused class members and 5 of 15 enum members. knip found the same 5 of 15 enum members and has no class-member check in version 6. Precision, agreement with knip on real repositories, and reproducibility

Pinned corpus

RepositoryPackage managerCommit
create-t3-turbopnpm8f945b7bb3bf
vue-corepnpm24c9d0bffb22
tanstack-querypnpm73c5686de77b
babelyarn7750b3d69123
npm-clinpmfc517df18fb5
angularpnpm37563fc32267
vscodepnpm6b7063d8883d
n8npnpmc1420c662538
next-jspnpme8ec2aed9266

The full SHAs, the tool versions, and the declared knip failures are in tools/bench/corpus.toml. The benchmark runs only in CI, as a dispatched workflow on a GitHub-hosted runner. Harness and how to reproduce

Note: skif is not uniformly faster than everything. It is faster than knip on every repository where knip completes, and faster than syncpack on every target, but sherif beats it on the three largest repositories for the manifest checks, and it missed its own 5x target against knip on angular and n8n. What it does give you is one tool, one configuration file, and one report in place of three, without running your project's code, and a skif migrate that makes trying it cheap: run npx @polylint/skif migrate --dry-run in a repository that already uses sherif, syncpack, or knip, and it prints the skif.toml and what it could not translate.

I'm happy to hear any comments. If you find the tool useful, star it. It really does help. And of course, I'd love to see people use it and get involved with the project.


r/typescript • • 9d ago

a ReBAC authorization platform where your permission schema is just TypeScript (open source, MIT)

6 Upvotes

Hey r/typescript 👋

My team and I been working on peretyn, an open-source authorization platform for TypeScript apps. You describe who can do what as relationships between things (users, teams, documents, whatever your app has), and your app asks one question: is this allowed?

A few highlights:

- The schema is plain TypeScript. No separate DSL to learn. Your types and relations are checked at compile time, so a typo in a permission name fails the build instead of failing in prod.

- Built on OpenFGA. It's the same relationship-based model as Google Zanzibar, so roles, sharing, teams and nested access all fit without piling up special cases.

- Self-hosted in one command. One install script brings up the whole stack: Postgres, the runtime, the control plane and a dashboard. There's also a local mode if you just want to poke at it.

- SDK + CLI. Use the SDK in your app and the CLI to ship your schema like any other piece of infrastructure.

- Open source, MIT licensed. Whatever you build on it stays yours.

The landing page is a bit of an experiment too: you walk through it as user:visitor, and each section unlocks as you earn new relations in your own little permission graph. It's probably the quickest way to get the idea, and there's nothing to install.

Feel free to give it a look: https://peretyn.dev

Docs: https://docs.peretyn.dev and GitHub: https://github.com/peretyn/peretyn

Heads up, it's early (pre-1.0), so expect some breaking changes between minor versions. That's exactly why I'd love feedback now: does the approach make sense? Is anything confusing? What would stop you from using it? Roasts welcome too 🙂

Thanks for reading!


r/typescript • • 10d ago

I've spent 3 years on a TypeScript library for generating Excel reports from a typed schema, v5 just shipped

27 Upvotes

Hey r/typescript,

I've been building typed-xlsx for about 3 years now, it's a library for generating Excel reports from TypeScript : https://typed-xlsx.vercel.app

It only writes files, so for reading or editing existing spreadsheets SheetJS or ExcelJS are what you want. But if you have typed data and need to turn it into a structured report, from a 3 column export to a multi-sheet pack with formulas, totals, charts and pivots, I honestly think it's the best option out there.

You describe the columns once, typed against your row type:

type Invoice = {
  id: string;
  customer: { name: string };
  qty: number;
  unitPrice: number;
};

const invoices = createExcelSchema<Invoice>()
  .column("id", { header: "Invoice #", accessor: "id" })
  .column("customer", { header: "Customer", accessor: "customer.name" })
  .column("qty", { header: "Qty", accessor: "qty" })
  .column("price", { header: "Unit price", accessor: "unitPrice" })
  .column("total", {
    header: "Total",
    // written as =(C2*D2) in the file
    formula: ({ refs }) => refs.column("qty").mul(refs.column("price")),
    summary: (s) => [s.formula("sum")],
  })
  .build();

The same schema works for any size of export:

// in memory
const workbook = createWorkbook();
workbook.sheet("Invoices").table("invoices", { rows, schema: invoices });
await workbook.writeToFile("./invoices.xlsx");

// streamed, e.g. 500k rows from a DB cursor
const stream = createWorkbookStream();
const table = await stream
  .sheet("Invoices")
  .table("invoices", { schema: invoices });

for await (const batch of cursor) {
  await table.commit({ rows: batch });
}
await stream.pipeToNode(res);

It's fast: 200k styled rows stream in about 3.5s with memory flat around 275 MiB, roughly 3x faster than v4. Zero dependencies, runs on Node, Bun, Deno and Cloudflare Workers.

Files look clean with no styling at all, and branding is a theme with a few colors. Per-row styles and native Excel conditional formatting are there when you need them.

The types go past accessors: a typo like customer.nam gets a "did you mean", a checkbox column only accepts booleans, a chart's y has to be numeric, and formulas reference columns by id so a wrong id doesn't compile. Formulas are optional, you can also just compute values in TS.

Also in there: native Excel tables, dynamic columns, sub-rows, dropdowns and validation, sheet protection, hyperlinks, images, sparklines and more. The playground has full workbooks for most of it.

It ships an agent skill too (npx skills add ChronicStone/typed-xlsx), and since everything is typed, tsc tells the agent when it got something wrong.

Repo: https://github.com/ChronicStone/typed-xlsx Docs: https://typed-xlsx.vercel.app Playground: https://typed-xlsx.vercel.app/playground

Feedback welcome, especially if you've built Excel exports in TS before.


r/typescript • • 9d ago

Nx monorepo with Node.js + Angular projects

9 Upvotes

We are currently using Nx (v23.x) to manage multiple interdependent projects. The monorepo contains both Node.js packages and Angular applications/libraries.

We still rely on TypeScript v6 and path aliases instead of project references, as Angular does not support them yet.

Is there anyone who's managed to have both TypeScript v7 and v6 on the same Nx monorepo, and correctly build Node.js packages with v7, and Angular applications/libraries with v6? Is this even possible? Note that Angular projects may reference shared libraries (that should be buildable in isolation with TS7 too).

I'm looking for others' experiences as I don't want to find myself on TS6 forever. The status quo is not great honestly.


r/typescript • • 9d ago

The future of Software Engineering is boring

Thumbnail
packagemain.tech
0 Upvotes

r/typescript • • 10d ago

trpc-demo-link: Build demos using tRPC client links that mock your API without changing your app/components

Thumbnail
github.com
1 Upvotes

Hi all ! Wanted to share this example repository I made that shows how I build demos using tRPC by minimally mocking routes that are called while viewing the demo (organization).

My TypeScript types are probably cursed but they enforce that newly introduced routes that could break the demo must be mocked. If you you tRPC or have a similarly-shaped SPA this could be useful for you!


r/typescript • • 10d ago

It Depends - TypeScript Debated

0 Upvotes

I wrote this book, and it took me nearly a year to complete. It's about TypeScript practices. It's opinionated, and it's meant to be a little "lighter" to read.

The idea is pretty simple: instead of writing another conventional technical book that tells you what to do, I wanted to build something around debates between developers. Different personalities, different philosophies, different approaches to solving problems. They argue, challenge each other's assumptions, bring working code into the discussion, and sometimes even change their minds.

And here's the thing: not every debate has a clear winner. Sometimes there's a verdict, sometimes the discussion remains open. Because that's how software engineering actually works.

Let me address the question you're probably all thinking right now: Yes, I used AI. Extensively.

However, all the scripts are mine. The voices are mine, the subjects are mine, the debates are mine.

So, what do I mean when I say AI was used extensively?

It helped shape the book and organize its content. It helped with spelling and grammar, refining tones, reviewing the material, making sure all the examples actually work, shaping the chapters themselves, and even helping with the printing process (there's a print version!) and the cover.

I didn't let AI write the text by itself. That was my one rule when working with AI on this book.

The book is free and open source. You don't have to pay a dime to read it. If you prefer a physical copy, there's also a print version available on Amazon, which, for obvious reasons, does cost some money.

Anyway, I'd genuinely love to hear what you think. Whether it's feedback about the content, the format, the opinions, or even the way the book was written.

you can read it here https://eliraz-refael.github.io/it-depends-ts-book/

In there you can find the link to the print version as well.


r/typescript • • 12d ago

getElementById with type guard and variable name guard

13 Upvotes

I've been trying to write a TypeScript wrapper around document.getElementById. I've got something that I'm almost happy with, so I'll start with that, then I'll explain my motivations and you can decide whether this makes sense or not, or which of my assumptions is most wrong.

There's a type guard, which means it will throw an exception if document.getElementById returns an element of the wrong type.

There's also what I'm calling a variable name guard. The wrapper returns an object with a single property with the same name as the html id. This stops the variable name from getting out of sync with the id accidentally - a mistake I seem to be quite prone to, I'm afraid.

Here's the code:

export const getElementById = <K extends string, V extends HTMLElement>(
    elementType: { new (): V },
    id: K,
): Record<K, V> => {
    const elm = document.getElementById(id);

    if (elm instanceof elementType) {
        return { [id]: elm } as Record<K, V>;
    } else if (elm === null) {
        throw new Error(`Element ${id} not found`);
    } else {
        throw new Error(`Element ${id} is of unexpected type, ${elm.nodeName}`);
    }
};

And it's called like this:

import { getElementById } from './getElementById';

const { mmEditor } = getElementById(HTMLTextAreaElement, 'mmEditor');
const { parseButton } = getElementById(HTMLElement, 'parseButton');
const { parseOutput } = getElementById(HTMLElement, 'parseOutput');
const { mmpEditor } = getElementById(HTMLTextAreaElement, 'mmpEditor');
const { unifyButton } = getElementById(HTMLElement, 'unifyButton');
const { unifierOutput } = getElementById(HTMLElement, 'unifierOutput');

When presented with vanilla html DOM code like this, the first question I would always ask is: why haven't I used a web-framework?

In this case, there's a package that I've written, and I wish to demonstrate its use in a web environment. So I'm trying to be inclusive, and write something you can hopefully follow whether your preferred framework is React, Angular, Vue, etc. It being demo code also explains why I wanted nice clearly worded exceptions and then made no effort to catch them.

I have unconsciously excluded JavaScript developers, however. Previously I have written such examples in JavaScript in the hope to include everyone. But this time I automatically chose TypeScript and didn't realize what I'd done until I'd almost finished it. It's 2026, is it OK to exclude JavaScript devs?

The only thing that makes me unhappy about this code is the 'as' statement. You should be able to satisfy yourself that it's correct and the type can't be anything else, but - and this is kind of the point of using a typed language - I'd rather you didn't have to. Unfortunately it's an inference that TypeScript itself doesn't appear to be able to make, and I can't find a way around that.

The elementType which is passed in might be worth elaborating on. I started with one function per element type, and when I combined them, I ended up with this, which would be nice if it would compile

const getElementId = <T extends HTMLElement>(id: keyof Record<string, T>) => {
    const elm = document.getElementById(String(id));
    if (elm instanceof T) {
        return { [id]: elm } as Record<string, T>;
    } else {
        throw new Error(`Element ${id} not found or wrong type`);
    }
}

src/index.ts:23:24 - error TS2693: 'T' only refers to a type, but is being used as a value here.

But it's hobbled by the need to transpile into JavaScript and can't take the type with it. So we pass the elementType in instead, which is defined as an object which has a constructor returning the expected element type. That we can do an instanceof on.

Thanks for reading. It's been nice to have a small piece of code with an easily understood purpose to talk about. That doesn't happen very often. When I start writing a program I'm happy to put any old runtime type check in, just to pander to the compiler's whims, but here I've finished up with something that does make it easy to hack around with a piece of code because it tells me clearly when I inevitably screw up. Anything with a generic in it is always a fun puzzle, I find, and I mean that both in a good and a bad way. I hope you found this interesting, what do you think?


r/typescript • • 12d ago

What happens when a side project you abandoned years ago suddenly becomes relevant again?

0 Upvotes

A few years ago, when Deno was first announced, I started building a NestJS-style framework that could run on both Node.js and Deno.

Like many side projects, it eventually ended up collecting dust.

But the JavaScript ecosystem kept evolving. New runtimes and environments emerged, like Bun and Edge runtimes, and I realized the original idea was more relevant than ever.

So I dusted off the code, rethought a few things, and brought the project back to life.

Today, I'm releasing the first public beta of CHO (which, somewhat amusingly, is already at version 3!) to gather feedback from the community.

CHO runs on every JavaScript/TypeScript runtime, uses native JavaScript decorators instead of TypeScript's legacy decorators, and has zero dependencies.

It's still early days, and I'd love to hear what you think, especially from developers interested in framework design and modern JavaScript.

🦋 https://github.com/cho-js/cho


r/typescript • • 13d ago

Surprising type of a filtered array

8 Upvotes

I have an array that contains a mix of number and string values, in other words its type is (string | number)[]:

a = [0, 1, 2, NaN, 'x']

I wanted to filter only the numeric values 0, 1 and 2 that are not NaN, so I used a perfectly ordinary filter() call:

numbers = a.filter(n => typeof n === 'number' && !isNaN(n))

However, to my surprise the array "numbers" still has type (string | number)[], which logically makes no sense. No string value can pass the filter.

However, if I split the "and" expression to two separate filter() calls the array does get type number[]:

numbers = a.filter(n => typeof n === 'number').filter(n => !isNaN(n))

What's the reason for this surprising behaviour? Is there a general TypeScript principle that applies here?

I'm experienced in JavaScript, however not super well-versed in TypeScript.


r/typescript • • 12d ago

A package for standardizing logging? Looking for thoughts

0 Upvotes

Hey!

How do you guys currently approach event logging?

After reading https://loggingsucks.com/ (like about a year ago), I thought of creating a small TypeScript package where you define a logger with a specific expected output log format, then the tool is used to add context/data during an event/request and finally the tool writes one structured log at the end checking for missing fields.
I've never actually did it, because I doubted that it'd be useful. I also heard pinojs has more or less something like this, but without any actual validation. However, recently I've quickly wrapped up a PoC tool.

The tool (LogPal): https://pages.doteric.net/logpal/ (Of course a lot of it is "vibe code", but it's just a PoC)

It’s a proof of concept for now. If the idea seems useful, I can definitely put the work into making it production ready. I wanted something that you don't have to do almost any configuration, you can just use it out of the box and if really needed then add some extra configuration.

Do you think it's worth investing into such tool? Or it'll become yet another logging tool like various different ones (pino, evlog, winston etc.)? Would you use something like this, or is it better handled within each project separately?


r/typescript • • 14d ago

Refactoring my vibecoded TS repo

0 Upvotes

TLDR: refactoring my codebase feature wise and wsnt to make sure this time it doesn't spiral out like the slop we did with claude in the last 6 months.

Stack: TS Express Prisma and Psql

So, I work as an SDE1 at a startup. Honestly, things got super messy around here because our managers just kept pushing for new features every single day. I finally decided I had to stretch out this project timeline. I am using this extra time to completely clean up my code and move it to a way more maintainable structure. I am ditching our messy, sort-of layered architecture and switching over to a vertical slicing setup. I am also adding clear readme files for every single module, putting up Pino for proper logging, and setting up the actual test suites we need.

This is what I want to ask the community, how can I make sure this migration hits all the right software development best practices? I really want to set things up so that Claude does not mess up my codebase ever again. Any Repo references or stack


r/typescript • • 16d ago

Introducing Skif - a repository/monorepo linter written in Rust

0 Upvotes

Hi Peeps,

I want to share with you a tool I am working on. Its still early, but I already use it and it works well.

So story goes like this - I was working on restructuring a very large monorepo with disparate package managers and versions into a single PNPM workspace. When I was finished I decided I am going to enforce certain conventions so it could not drift again without failing CI. I set this up, and found myself using several different tools -Sherif, Syncpack and Knip to ensure that the repository doesn't drift again. This setup, while working, is rather clanky and also suffered from some issues - mainly performance, but also a few bugs.

I therefore decided I will build my own tool. I forked Sherif as a baseline, and built on top of it while substantially rewriting and extending its capabilities. The result is skif: a Rust linter and enforcement tool for JS/TS dependencies and monorepos.

skif replaces sherif and syncpack, and most of what knip does (the aim is to offer a full replacement for Knip in the future) in a single, ultra fast, binary.

npx skif-cli              # lint the workspace or package you are in
npx skif-cli --fix        # apply safe fixes
npx skif-cli migrate      # turn sherif, syncpack and knip config into a skif.toml

Where it came from

skif started as a fork of sherif, and the workspace and manifest rules are ported from it. The version and catalog policies follow syncpack's model. The dead-code analysis follows knip's issue types.

It has since gone past the fork. It ports every sherif rule, adds new ones and fixes, and runs faster on every target measured. On the syncpack side it enforces version, range, banned-dependency and catalog policy.

What it deliberately does not do is sync versions. skif is a linter: it tells you a policy is broken and fails CI. Moving versions in step is left to specialized tools or the package manager's themselves. If you need this, use syncpack for example.

What it checks

42 rules:

  • Manifests and workspace: empty dependency maps, types in dependencies, root private and packageManager, unsorted dependencies, workspace globs that match nothing, members without a package.json.
  • Version policy: mismatched versions, semver range policy, banned dependencies, catalogs (missing entries, unused entries, references that do not resolve), workspace: protocol, peer dependency compatibility.
  • Dead code: unused files, exports, types, enum members and dependencies; unlisted dependencies and binaries; unresolved imports; circular imports. Leveraging the OXC ecosystem for this.

It also adds some new rules, such as incompatible-peer-dependencies and workspace-protocol.

Skif lifts the idea of framework plugins - which allow it to understand different types of entrypoints (e.g. Next.JS, Vite, Storybook etc.). But unlike Knip, which loads these files, Skif doesn't actually load code - it only statically analyses it. This removes a potential surface for code execution, and is altogether much faster, although it does bring in the potential to some imprecision.

Supported package managers

Skif supports all major package managers - npm, pnpm, Yarn classic, Yarn Berry as well as Bun. It does not support Deno, although if there is a need it might in the future. It also supports Rush and Lerna workspaces.

Benchmarks

Speed

Medians of 15 runs on a 4-vCPU Linux VM, pinned public repositories, dependencies installed:

Repositoryskifknip
create-t3-turbo32 ms2.0 s
vue-core62 ms1.7 s
tanstack-query375 ms4.5 s
npm-cli99 ms968 ms
babel884 ms7.2 s

Manifest checks alone (--no-js) against sherif and syncpack:

Targetskifsherifsyncpack
create-t3-turbo4.6 ms36 ms41 ms
babel9.4 ms37 ms280 ms
2,000 generated packages102 ms130 ms655 ms

sherif is already fast Rust, so the margin there is small: 1.3x at 2,000 packages. The real win is knip, and not paying for three processes.

Links

P.S.

Note: This is an early project, it is on v0.2.0. I am very eager to have users, since it will improve the tool and help me fix bugs. But do expect some issues!

Thanks for reading, this was a human written post (the benchmarking data was done by an LLM). If you find the tool useful, star it!