Hiroki Osame's Avatar

Hiroki Osame

@hirok.io

πŸ‘€ hirok.io ⚑️ Creator of @tsx.is πŸ“¦ Creator of https://pkg-size.dev πŸ’ž Open Source https://github.com/privatenumber πŸ’Ό SWE @ Square

1,369
Followers
97
Following
68
Posts
13.11.2023
Joined
Posts Following

Latest posts by Hiroki Osame @hirok.io

Preview
GitHub - privatenumber/npm-pkg-settings: Programmatic access to npm package publish settings Programmatic access to npm package publish settings - privatenumber/npm-pkg-settings

Made a JS API & CLI for npm package settings

Now you can easily update Trusted Publisher and Publishing Access settings from the CLI or in bulk with a script

github.com/privatenumber/npm-pkg-settings

02.03.2026 14:12 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
GitHub - privatenumber/doctor-json: Surgically edit JSON & JSONC strings while preserving whitespace, comments, and formatting Surgically edit JSON & JSONC strings while preserving whitespace, comments, and formatting - privatenumber/doctor-json

New package: doctor-json πŸ‘¨πŸ»β€βš•οΈ

An util to manipulate JSON/JSONC while preserving their formatting and comments

The API is so simpleβ€”manipulate the parsed object just like you would any plain object, and stringify!

github.com/privatenumber/doctor-json

02.03.2026 14:02 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
GitHub - privatenumber/poof: Fast, non-blocking rm -rf alternative. Deletes files instantly while cleanup runs in the background. Fast, non-blocking rm -rf alternative. Deletes files instantly while cleanup runs in the background. - privatenumber/poof

Made a little tool because I've wasted too much time waiting for `rm -rf node_modules` in large repos

Now I can just do `poof node_modules` πŸ’¨

github.com/privatenumber/poof

19.12.2025 15:27 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
GitHub - privatenumber/minification-benchmarks: πŸƒβ€β™‚οΈπŸƒβ€β™€οΈπŸƒ JS minification benchmarks: babel-minify, esbuild, terser, uglify-js, swc, google closure compiler, tdewolff/minify, oxc-minify πŸƒβ€β™‚οΈπŸƒβ€β™€οΈπŸƒ JS minification benchmarks: babel-minify, esbuild, terser, uglify-js, swc, google closure compiler, tdewolff/minify, oxc-minify - privatenumber/minification-benchmarks

`oxc-minify` is now the recommended minifier when using @rolldown.rs!
While continuously tweaking the performance, the minifier is already outperforming `esbuild` in terms of speed and size.

Check out the benchmark by @hirok.io for perf comparison.

github.com/privatenumbe...

27.04.2025 15:33 πŸ‘ 12 πŸ” 2 πŸ’¬ 2 πŸ“Œ 0
Preview
Prototyping with AI models - GitHub Docs Find and experiment with AI models for free.

Yep!

Limit depends on the model:
docs.github.com/en/github-mo...

15.03.2025 06:01 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

It's so crazy I can do this for free now

If you're interested in how I do this, I'm querying GPT 4o on @github.com Models via GH Actions on every PR πŸ™

Here's the system prompt:
github.com/privatenumbe...

15.03.2025 05:00 πŸ‘ 2 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Post image

πŸ€– Minification Benchmarks now includes an AI analysis with clear recommendations

No more manual analysisβ€”read which minifier is best for your needs

It's also really entertaining to read:
github.com/privatenumbe...

15.03.2025 04:58 πŸ‘ 5 πŸ” 1 πŸ’¬ 1 πŸ“Œ 0
Documentation - Modules - Reference Module syntax and compiler options reference

Hmm yeah I think the conversation happened around there

I think it was kind of a hidden exchange on a commit or something...

The closest thing I could find was in the docs where imports is mentioned as a standard replacement for paths:

www.typescriptlang.org/docs/handboo....

17.01.2025 12:12 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

I vaguely remember a TypeScript discussion where they were considering deprecating tsconfig#paths in favor of package.json#imports (but concluded it was too early?)

I searched around but couldn't find it...

Does this ring a bell for anyone?

17.01.2025 00:50 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Post image

dtsroll is a Type Script declaration file (.d.ts) bundler

Use it to:
- Tree-shake unused types
- Bundle in private monorepo deps
- Improve type-checking perf

πŸ‘‰ github.com/privatenumber/dtsroll

11.01.2025 13:42 πŸ‘ 57 πŸ” 6 πŸ’¬ 1 πŸ“Œ 0
Post image

Great end to 2024 πŸŽ‰

🌟 10k GitHub stars
⬇️ 19.5M downloads a month

Thank you everyone ❀️

31.12.2024 14:51 πŸ‘ 9 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

Very cool! Thanks for making this Kevin πŸ™Œ

30.12.2024 02:27 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Good point!

Hope that Issue gains more momentum soon

Import Attributes have been supported and stable for a while now

30.12.2024 02:24 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Static Asset Handling Next Generation Frontend Tooling

Thanks for sharing! I didn’t know it had better web support

Yep, bundlers conventionally use query parameters for this: vite.dev/guide/assets

But ImportAttributes has been around for a while now and can work seamlessly across platforms. I wonder why it hasn't caught on

25.12.2024 08:20 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Post image

In your TS project, enabling verbatimModuleSyntax is highly recommended for predictable compilation

If you haven't yet because of the errors it produces, I made an auto-fixer:
github.com/privatenumbe...

25.12.2024 08:13 πŸ‘ 53 πŸ” 7 πŸ’¬ 0 πŸ“Œ 2
Modules: ECMAScript modules | Node.js v23.5.0 Documentation

Why haven't Import Attributes taken off? Seems it stopped at JSON support

It would be great to be able to import text files and create a run-time dependency on it:
```ts
import fileContent from './file.txt' with { type: 'text' }
```

nodejs.org/api/esm.html...

24.12.2024 00:59 πŸ‘ 10 πŸ” 0 πŸ’¬ 4 πŸ“Œ 0

You’re killing it πŸ”₯

23.12.2024 04:24 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Thank you and HNY!

23.12.2024 04:23 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Post image

Good year 😊

22.12.2024 15:01 πŸ‘ 24 πŸ” 0 πŸ’¬ 1 πŸ“Œ 1
Preview
GitHub - privatenumber/vite-css-modules: Vite plugin for correct CSS Modules behavior Vite plugin for correct CSS Modules behavior. Contribute to privatenumber/vite-css-modules development by creating an account on GitHub.

vite-css-modules now supports Vite 6!

πŸ‘‰ github.com/privatenumber/vite-css-modules

19.12.2024 07:00 πŸ‘ 45 πŸ” 3 πŸ’¬ 1 πŸ“Œ 0

Unsure what you mean by "tree-shake the external dependencies"

Externalized deps are excluded from the bundle, so it's never tree-shaken

19.12.2024 04:53 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Tree Shaking | webpack webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.

Webpack relies heavily on Terser to handle dead code elimination: webpack.js.org/guides/tree-...

SWC works as an alternative because it's the Rust port of Terser: github.com/swc-project/...

19.12.2024 04:52 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Preview
Think twice before importing package source files Importing source files from packages during development can cost you more than it saves

Are you using tsx to import source files across workspace packages?

You may be making expensive trade-offs without realizing it

Here's a breakdown of the risks and better alternatives:

πŸ‘‰ hirok.io/posts/importing-source-files-in-dev

16.12.2024 22:21 πŸ‘ 6 πŸ” 1 πŸ’¬ 1 πŸ“Œ 0
Preview
GitHub - privatenumber/pkgroll: πŸ“¦ Zero-config package bundler for Node.js + TypeScript πŸ“¦ Zero-config package bundler for Node.js + TypeScript - privatenumber/pkgroll

Do yourself a favor and delete those hacks & brittle build steps you cobbled together, for your library to be consumable from both esm & cjs.
Then simply make sure your package.json declares the entrypoints you want & let pkgroll by @hirok.io do the rest!
What a delightful little tool ❀️

14.12.2024 16:17 πŸ‘ 6 πŸ” 1 πŸ’¬ 2 πŸ“Œ 0
Preview
Change Request: PostCSS syntax support Β· Issue #29 Β· eslint/css Environment ESLint version: Latest (Possible to include the version on the Code Explorer?) @eslint/css version: Latest (Possible to include the version on the Code Explorer?) Node version: N/A npm ...

Hey PostCSS experts, folks have requested the ability to parse PostCSS-specific syntax in ESLint, but I really don't know how to accomplish that. Your comments on this issue would be appreciated:
github.com/eslint/css/i...

11.12.2024 16:31 πŸ‘ 4 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

Love the distinction between link and file:// hard linking

I supported this in my β€˜link’ package as β€œpublish mode”

Is there a Watch mode to keep file:// dependencies up to date during development? (e.g. new files)

29.11.2024 02:25 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

I think this makes my point

A beginner shouldn't need to understand all that to wrap their head around
useEffect(() => {}, []) === onMounted(() => {})

This is about empathizing with beginners, not trivializing concepts we already get

24.11.2024 00:08 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

That would trigger on server as well, which may be undesired

And may even build up server memory via closure

23.11.2024 09:36 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Yeah, things make sense once they click

But I think theres room for improvement in how long it takes to get there

With unsemantic conventions like this, there’s more to learn before a beginner can read code without pausing to check the docs

23.11.2024 08:30 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

What if you’re not dealing with a DOM element?

In the case I saw, it was used to trigger i18n initialization

Not sure why it had to be on mountβ€”maybe to distinguish from server?

23.11.2024 08:22 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0