✂️ OUT NOW: Knip v4
- Significant speed bump (up to 80%!)
- Globbing with .gitignore files got a lot faster
- Built-in compilers for Astro, MDX, Svelte & Vue
- ...and more!
Read all about it in the v4 release notes:
@JoeAttardi
@ryanflorence
I have this as a function stored in .bash_profile (or similar):
mk() {
mkdir -p "$@" && cd "$@"
}
And more related aliases for jumping around:
✅ Available for work!
I sleep in monorepos, eat JavaScripts for breakfast & automate deliveries continuously to build the DX or UX your colleagues & customers deserve ❤️
Lars == JS/TS, frontend & tooling!
Hyped & typed for my next gig, how can I help you?
Tnx! Sharing = 🫶
Knip ❤️ Bun
Bun is now a first-class citizen, and Knip will detect dependencies used in your Bun shell scripts (no worries, I'm from the future)
✂️ And I know the feelings are mutual when running knip on knip itself:
time npx knip 2.3s
time bunx --bun knip: 2.0s
✂️ Knip v5.18.0 is out!
This one is all about the new --trace feature:
▶︎ Renders tree to trace where exports are used
▶︎ Follows re-exports, barrel files across workspaces!
▶︎ Debug issues reported by or with Knip
▶︎ Target specific files/exports (e.g. --target-file)
✂️ Update
✓ New domain:
✓ New docs in progress
✓ Published Knip v3 canary (expect v3.0.0 after the weekend)
→ Feel free to start using the docs and v3 canary, feedback most welcome. Here's excited for what's coming! ☀️
Can I ask for a favor? I need paid work.
Available to make an impact and help out with frontend, APIs, performance, automation, tooling and DevOps/CI.
Betting on JavaScript for well over 20 years. TypeScript is great.
Not afraid of large codebases, major refactorings or
Cool new project that removes unused exports based on a tsconfig.json file: ts-remove-unused. Small + clear scope, nice!
Added to the comparisons/alternatives page:
@kazushikonosu
created ts-remove-unused, go check it out:
✂️ Knip v5 is out!
This tiny but mighty release is a great little improvement around unused exports in namespaces.
v5.0.0 is release
#300
, go check it out!
✂️ Render me an absolute fool, but I just want to see your codebases uncluttered.
As an example, it just took 30 minutes to completely unravel Microsoft's Playwright codebase and set it up for tidyness.
And so can you.
✂️ Knip is actively used by some cool & large companies:
▶︎ Algolia (→
@algolia
)
▶︎ Grafana (→
@grafana
)
▶︎ Microsoft (→
@OpenAtMicrosoft
)
▶︎ Shopify (→
@ShopifyEng
)
Would be good to see such companies support projects like Knip! What can I do to make it happen?
Just published "Using OpenAI with JavaScript"
In which I try to fill a gap for frontend people getting serious about OpenAI, but find everything is Python!
@NicoloRibaudo
@jarredsumner
> often
Think you might be underestimating how many systems and servers use JSON as a transportation format, and will all straight up choke on comments in JSON.
Better use a different extension, is that such a problem.
✂️ New to Knip?
- Enjoy! Boring stuff should be automated indeed.
- Configuration issues? Feel free invite me to your PR or reproduction, I'm happy to assist! ❤️
- Is it slow in your large monorepo? v4 is on the way 🚀
✂️ In the next version of Knip:
- knip --cache
- knip --watch
- knip-bun
Recent updates include:
- Improved support for CommonJS
- New plugins:
@tothemoonrepo
, Wrangler (Cloudflare CLI)
- Migrated dev setup to Bun +
@biomejs
- Tests still run in Node.js too
- Improved docs
✂️ Knip v5.3.0 is out
- the recent perf wins enabled by default
- complete coverage like v3 for edge cases if you need it
Feels like I've finally hit the sweet spot here, LFG
✂️ Knip v5.10.0 is out!
🆕 knip --cache
🆕 knip --watch
🆕 plugins: oclif, Cucumber.js (total: 60 plugins!)
🆙 knip --fix improved
⬇️ 63% reduction in # of dependencies (from 234 to 87)
ℹ️ bug fixes
The most major minor so far. Here's a quick walk-through: 👇
✂️ Knip knips Knip
Managed to reduce the number of its own dependencies with 63% (from 234 to 87)!
Available in canary now, in v5.10.0 soon.
Faster installations, much smaller footprint 👣
✂️ Knip is actively used by some cool & large companies:
▶︎ Algolia (→
@algolia
)
▶︎ Grafana (→
@grafana
)
▶︎ Microsoft (→
@OpenAtMicrosoft
)
▶︎ Shopify (→
@ShopifyEng
)
Would be good to see such companies support projects like Knip! What can I do to make it happen?
@housecor
Disagree, REST is still a useful term, _because_ it's old and widely understood.
Because half of us doesn't know what HATEOAS means, does not imply REST is a bad term.
We can talk about education and implementation, but I don't think that should start with using "JsonApi".
Thrilled to be working with the
@gritdotio
team starting next week! Their philosophy and goals couldn't be more aligned with my own 🤩
Thanks
@morgantepell
for the opportunity 🙏
So excited to share I'll be working with an awesome team soon! Will share more when I can.
The help & feedback I got here are so heartwarming. Can't even begin to express my gratitude, thank you all ❤️
Trust me, it took a while to get over it and "just ask", but so glad I did.
So excited to share I'll be working with an awesome team soon! Will share more when I can.
The help & feedback I got here are so heartwarming. Can't even begin to express my gratitude, thank you all ❤️
Trust me, it took a while to get over it and "just ask", but so glad I did.
Can I ask for a favor? I need paid work.
Available to make an impact and help out with frontend, APIs, performance, automation, tooling and DevOps/CI.
Betting on JavaScript for well over 20 years. TypeScript is great.
Not afraid of large codebases, major refactorings or
✂️ LFG 🚀
What matters is the number of repos kept in check and the code/dependencies removed. GitHub says 1811 dependent repositories, 6118 stars. Considering Knip is a niche tool for the most diligent of developers, this is not bad, not bad at all :)
✂️ Can't believe Knip is about to pass 500K downloads per week 🎉
However, full disclosure/PSA: based on supply and demand development has been slowing down for a while. Bug reports are still accepted, but proper reproductions required. Don't hold your breath for new features.
@Randynamic_4
@kadena_io
Thanks a lot, Randy & the Kadenians! Head's still spinning from Doug's dice 🎲🎲 and other mind-blowing Kadena videos I'm watching today. Let's go!
✂️ Knip update
Happy to share I've completed a refactor to improve the dependency graph Knip uses internally to analyze your repo. Fixed a bug and made it easier to grasp along the way. Might be interesting to open this up in the future.
✂️ The next release of Knip will be so good. If you've been frustrated with funky results then this one's for you. Squashing a whole category of bugs with unprecedented preciseness 🔪
✂️ Update!
- Out now: Knip v3.3.3
- More speed 🚀
- Better peerDependencies handling
- Better JSDoc handling
- Better docs
- JSONC Schema
- ..
💡 Did you know... Knip is continuously tested against various projects before releases to prevent regressions
✂️ Can't believe Knip is about to pass 500K downloads per week 🎉
However, full disclosure/PSA: based on supply and demand development has been slowing down for a while. Bug reports are still accepted, but proper reproductions required. Don't hold your breath for new features.
✂️ Tiny flag, lots of opportunities
🔧 Starting today, you can add --fix to your Knip runs and it will remove unused exports, types and dependencies, so you don't have to.
🇳🇱 Flagged experimental, feel free to give it a shot! 🔧
Waited for the right opportunity, but today I'm excited to share I'll be joining a
#GoodCause
😊
@SeniorWebNL
helps Dutch people use computers & internet, and I'll be giving them my all to do everything frontend & devops. This is close to my heart, feels good!
✂️ Planned for the coming weeks: tips & tricks to get the most out of Knip. Improve documentation, probably fix some bugs.
Obviously the latest is the greatest, but I'd really recommend upgrading to v5.18 if you can.
Sometimes I feel a tad bit sorry for early adopters when Knip
✂️ Today is a good day! This morning I woke up with the news that Microsoft supports me with a great one-time boost. All motivated & stoked now 🤩🚀
Thank you
@microsoft
for sponsoring me on
@github
. You can join them at my sponsors profile:
Sad to see this is still controversial.
Don't optimize DX by adding hooks. Give devs a choice. They can add hooks themselves or do it in IDE, whatever. Single source of truth is centralized CI, stable branch.
"Don't make me think."
✂️ Update!
Did a major refactoring in Knip, paving the way for more optimizations that were not possible before (e.g. caching).
🚀 You can try it out today (v4 canary)!
warning: do not use a tool like + code search to delete a ton of unused code. It works too well.
I just did this in , and my boss said if I end the week with net negative lines of code committed, I'm in deep trouble.
Monorepos aren't easy.
It's an investment. Don't just throw some tooling together that look nice at first sight.
Set boundaries from the start, accept some cons, and at scale it can make you move so. much. faster.
Monorepo engineer should even be a role maybe. Monorepolice 👮
✂️ Knip v4.2.0 is out now!
- New
@netlify
plugin (for Netlify Functions)
- Much improved
@eleven_ty
plugin
- Internal refactorings (early & often!)
Massive shoutout to
@uncentr
, the front and center of this release, doing BOTH plugins 🚀
Knip ❤️ Astro
✂️ A fresh new Knip v2.34.0 brings you joy and...
- Brand new Astro plugin 🚀
- Define Knip config as (async) function
- Run Knip from another directory
- Bugfixes++
✂️ knip --cache just got a lot more efficient & faster.
Using the Node.js and Bun built-in (de)serializers, and less dependencies.
Thanks y'all! Enjoy Knip v5.22 🔥
Is there any good solution out there to (de)serialize JS objects directly from/to files? The objects contain Sets and Maps.
I have something that works well, but it's a two-step process:
- (de)serializer to JSON
- file-entry-cache (Prettier, ESLint use this too)
Ideally, this
Are you that cutting ✂️ edge type of developer, using Node.js v22 and compiling your code with TypeScript v5.5 beta? Knip has your back 🫡
Knip v5.11.0 is out and tested against the above, while supporting the new Type Imports in JSDoc 😎
✂️ Cutting egg Easter update! Work in progress:
🐣 knip --cache
🐣 knip --watch
The cache & watch features work across workspaces, when adding/deleting files, etc. etc.
🎬 Also had fun scripting a quick demo:
This platform has always been good to me. But eventually it's not the platform, it's the people. That's you!
Thank you for being part of my journey, it's been wonderful ❤️
✂️ Knip update! New plugins:
- Ladle
- React Cosmos
- Rspack
- Rsbuild (wip)
- cypress-multi-reporter
ALL contributed or sponsored 🙏
Additionally did some minor improvements & bug fixes 🔧
Enjoy, and have a nice day! ☀️
@JoshuaKGoldberg
Sorry to hear this, Josh. You're one of my all-time favorites in the OSS community, and I've learned so much from you.
Cliché but true: take care of yourself, before you can take care of others. Sincerely hope you'll somehow find that 2022 spirit back!
It's so liberating and efficient to optimize for deletion. Whatever you're building, the abstraction or coupling you're into, it'll all be obsolete sooner or later. Think with deletion in mind, lots of best practices & patterns auto-follow suit. Prepare for reality 🦋
✂️ Added a page about performance with Knip
→ Barrel files and star imports 🐢
→ Workspace Sharing ♻️
→ .gitignore files 🚫
Not "required knowledge", but might be good to realize if Knip runs slow on your codebase.
🙏 Not my favorite thing to do, but here I am asking for sponsorships. Do you or your company value any of my open source projects (e.g. Knip, release-it)? It would mean the world to me if you could make this happen at your company! ❤️
🚀 This means I can spend more time
My most frequently used aliases:
alias g=git
alias p=pnpm
alias b=bun
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias -- -="cd -" # Go to previous dir with -
alias cd.='cd $(readlink -f .)' # Go to real dir (i.e. if current
The new Set methods are great, you're going to use them more than you'd think (I know I will!). Sets become even more appealing with those methods included. Stage 4, most of the methods are already available in V8, Chrome, Safari.
ECMAScript excitement 😉
Congrats to
@bakkoting
on advancing Set Methods to Stage 4 this week
@TC39
🎉
Set.prototype gains these methods:
🔶 intersection
🔶 union
🔶 difference
🔶 symmetricDifference
🔶 isSubsetOf
🔶 isSupersetOf
🔶 isDisjointFrom
✂️ Little lazy Sunday Knip update
1️⃣ Published @knip/create-config to minimize install guide:
$ npm init @knip/config
^ Can be extended with more install/config helpers, etc.
2️⃣ Added features overview page: