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)