Skip to content
6 changes: 3 additions & 3 deletions npm-list-linked.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const {getLinked} = require('./get-linked');
const NODE_MODULES = 'node_modules';

function printLinked(cwd, level = 1) {
const indentation = ' '.repeat(level * 4);
const linked = getLinked();
const indentation = ' '.repeat(level * 4) + '—'.repeat(2) + '⌲ ';
const linked = getLinked(path.join(cwd, NODE_MODULES));

if(level === 1) {
if(linked.length > 0) {
Expand All @@ -20,7 +20,7 @@ function printLinked(cwd, level = 1) {

linked.forEach(link => {
const version = fs.readJsonSync(path.join(NODE_MODULES, link, 'package.json')).version;
console.log(indentation + link, version);
console.log(indentation + link, '@' + version);
printLinked(path.join(NODE_MODULES, link), level + 1);
});
}
Expand Down