DEV Community

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

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

Takuya Matsuyama
Indie developer based in Osaka, Japan. A solo dev of Inkdrop: https://www.inkdrop.app/
・1 min read

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!

Discussion (0)