Skip to content

Knip

Find unused files, dependencies and exports in JavaScript and TypeScript projects

馃А Introduction Video

James Shopland created this great introduction and overview of Knip:

馃А Contributors

Special thanks to the wonderful people who have contributed to this project!

馃А Articles

馃А Testimonials

Quinn Slack@sqs

warning: do not use a tool like https://knip.dev + code search to delete a ton of unused code. It works too well.

I just did this in https://github.com/sourcegraph/cody/pull/2705, and my boss said if I end the week with net negative lines of code committed, I'm in deep trouble. undefined

1:55 AM 路 Jan 13, 2024

replies6
retweets2
likes28
bookmarks7

Greg Berg茅@gregberge_

Ran http://knip.dev in @argos_ci, and boom 馃挜! Dead code detected instantly. With a good config, it can run on CI to keep projects clean. Installing this tool should be a no-brainer, like Prettier or ESLint.

Kudos, @webprolific! 馃憦 undefined

11:00 AM 路 Nov 30, 2023

replies1
retweets5
likes25
bookmarks13

Cory House@housecor

Problem:
馃毇 Your project has unused files.
馃毇 It has unused npm dependencies.
馃毇 It has unused TypeScript exports.

But you haven't noticed, because these things are hard to spot.

Solution: knip

I just used knip to find and resolve dozens of issues.

https://t.co/QmN3sNlmbm

2:44 PM 路 Aug 15, 2023

replies17
retweets163
likes968
bookmarks754

Piotr Gacek 馃悷@pkgacek

Knip helped me get rid of over 41k lines of code in legacy codebase 馃ズ馃ズ馃挄

4:51 PM 路 Nov 27, 2023

replies1
retweets0
likes1
bookmarks0

Gajus@kuizinas

Big fans of Knip at @Contra. Such an extremely well developed and maintained project

3:18 PM 路 Nov 27, 2023

replies1
retweets1
likes7
bookmarks1

Fernando@fernandoeeu_dev

I've manage to delete 6k LOC in the last 30 minutes 馃

Great job here @webprolific 馃憤馃徑

3:38 AM 路 Nov 21, 2023

replies2
retweets0
likes4
bookmarks0

Dominik 馃敭@TkDodo

knip is an amazing tool. Shoutout to @webprolific for building it 馃檶.

Not cleaning up correctly has a real maintenance cost. I've deleted lots of dead code - functions that were only used in tests and components that were only used in stories - all thanks to knip 馃殌.

8:59 PM 路 Oct 16, 2023

replies1
retweets3
likes39
bookmarks11

Michael Hoffmann@Mokkapps

馃洜锔 Knip

馃憠馃徎 Knip finds unused files, dependencies and exports in your JavaScript and TypeScript projects.
馃憠馃徎 Less code and dependencies lead to improved performance, less maintenance and easier refactorings.

https://github.com/webpro/knip

6:00 PM 路 Aug 28, 2023

replies0
retweets2
likes11
bookmarks3

Nicolas Carlo@nicoespeon

Knip is wonderful at finding out unused code/dependencies in a legacy JavaScript/TypeScript application

Recommend 馃挴

Here's how Josh used it to remove code bloat in Centered:

11:13 AM 路 Aug 22, 2023

replies1
retweets1
likes9
bookmarks0

Kailaash@BKailaash

Streamlining React projects with Knip:

Recently, I employed Knip for a project, and it worked wonders!

It efficiently resolved issues with removing
鉁 Unused files,
鉁 Unused npm dependencies,
鉁 Unneeded TypeScript exports.

A real time-saver for maintaining a clean and efficient codebase. 馃洜锔 #ReactDevelopment

https://t.co/IbJH2fIzsE

5:55 AM 路 Aug 21, 2023

replies0
retweets1
likes4
bookmarks1

Waldek Mastykarz@waldekm

Found a bunch of unused code, -dependencies, and unnecessary exports. Had just one false positive but overall pretty good. 10/10 would recommend.

If you鈥檝e got a JavaScript package/project use Knip and remove unnecessary code. 鉁傦笍

4:52 PM 路 Aug 19, 2023

replies0
retweets0
likes2
bookmarks0

馃А Selected Projects Using Knip

Use GitHub Search for package.json files containing 鈥渒nip鈥 for more projects and examples using Knip.

Have or know about a nice resource about or project using Knip? Feel free to propose a change and add it to this page!

ISC License 漏 2024 Lars Kappert