If you work with images with text, or scanned documents, here's a small but powerful OCR CLI It leverages Apple's Vision Framework so it's completely local Tip: give it to your agent to save on vision tokens! → npx mac-ocr ./image.png github.com/privatenumbe...
Hiroki Osame
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.3K followers98 following69 posts
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
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
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
Hiroki Osame reposted
Replying to @voidzero.dev
`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...
🤖 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...
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...
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
Hiroki Osame reposted
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...
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...
vite-css-modules now supports Vite 6! 👉 github.com/privatenumber/vite-css-modules
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
Hiroki Osame reposted
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 ❤️
Hiroki Osame reposted
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...
TIL the way you do onMounted in React is useEffect() with no dependencies react.dev/learn/lifecy... I rarely use React, but this feels kind of hacky to me I feel like the framework beginners learn web dev with should set better examples of semantic & readable code
Hiroki Osame reposted
Woah, I wish this guide existed when I had to figure this all out about a year ago. If you publish packages to NPM, this is a must-read. Also, check out the `publint` by @bluwy.me. It saved us from so many mistakes 👌
Confused about the `exports` field in package.json? I wrote a guide to break it down and walk you through it! 👉 hirok.io/posts/node-exports-guide
Confused about the `exports` field in package.json? I wrote a guide to break it down and walk you through it! 👉 hirok.io/posts/node-exports-guide
I was excited to see the perf impact for @antfu.me since he has a much bigger output Here are the results: sponsors.svg: 2.94 MB → 1.26 MB sponsors.wide.svg: 2.94 MB → 1.27 MB sponsors.past.svg: 2.15 MB → 919 KB sponsors.circles.svg: 2.99 MB → 1.39 MB More than 50% reductions for every file! 👍
New Sponsorkit v0.16 updates! github.com/antfu-collective/sponsorkit/releases/tag/v0.16.0
New Sponsorkit v0.16 updates! github.com/antfu-collective/sponsorkit/releases/tag/v0.16.0
You are up to date.