DEV Community

Samuel Beard
Samuel Beard

Posted on

4

Useful NPX

You probably use, or at least have heard of, npx if you work with Javascript. If not, look it up. It's really handy.

Here are some commands I run on the reg with npx:


npx okimdone npm install
Enter fullscreen mode Exit fullscreen mode

If you have your volume up, a voice will tell you when the command you entered is done. It's really handy for tasks that take ages but want to come back to after.


npx npm-check

# Options
-u - Interactive Updates
-y - Update everything
-s - Skip unused
-g - Global
Enter fullscreen mode Exit fullscreen mode

Checks your installed npm packages and gives you info about them. It's great for seeing if you have stuff in your package.json that your aren't actually using in your app.

Running npx npm-check -su will simply update all of your packages.


npx npkill
Enter fullscreen mode Exit fullscreen mode

Run this from the folder that holds all of your projects. It will list out every node_modules folder from there along with the amount of disc space it is using. You can then go through them and delete the node_modules folders individually by hitting the space bar.


npx generact
Enter fullscreen mode Exit fullscreen mode

If you are creating components for react, this is really useful.

Generact will duplicate a component you already have made and give it a new name. It will copy the old components file structure and change the component name anywhere it is written inside it.


npx samuelbeard
Enter fullscreen mode Exit fullscreen mode

Just thought this was neat.


If you know of any more npx tools that are super useful, bung em in the comments.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more