DEV Community

Cover image for [Alfred] How to display the latest version of npm packages with Package Managers Workflow
Takuya Matsuyama
Takuya Matsuyama

Posted on

 

[Alfred] How to display the latest version of npm packages with Package Managers Workflow

I'm using Package Managers Workflow on Alfred 4.
But it won't show the latest versions in the search result.
Here is how to make it display them like so:

Open the workflow directory

And then, open code/Npm.php file with editor.

Edit lines starting at line 29 as following:

            $this->cache->w->result(
                $this->id,
                $this->makeArg($name, $p->links->npm, "{$p->name}: {$p->version}"),
                "{$name}@{$p->version}", // Display version
                $p->description,
                "icon-cache/{$this->id}.png"
            );
Enter fullscreen mode Exit fullscreen mode

That's it!

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git