How to unstar uninstalled packages


#1

Ok so, via stars we can mass-install packages we like but it seems hard to maintain the starred packages list.
It’s easy to star currently installed packages but how do you unstar starred packages that you no longer have installed?


#2

This is a .sh script I have to just that:

apm starred --json > starred.json;
node -e 'fs = require("fs"); JSON.parse(fs.readFileSync("starred.json")).forEach(function(item) { console.log(item.name); })' > starred.list;
apm unstar `cat starred.list`;
apm star --installed;
rm starred.json starred.list;

#3

This very useful script used to work for me, but recently it doesn’t anymore on Windows (error output is not a tty).

I altered your script a bit so it works again:

apm starred --json > starred.json;
node -e 'const fs = require("fs"); let result = ""; JSON.parse(fs.readFileSync("starred.json")).forEach(function(item) { result += item.name + "\n"; }); fs.writeFile("starred.list", result)';
apm unstar `cat starred.list`;
apm star --installed;
rm starred.json starred.list;