ls-publishers
v1.0.2
Published
[email protected]:ljharb/ls-publishers.git
Downloads
47
Readme
ls-publishers
List your dependency graph, grouped by publishers.
Example
CLI
> ls-publishers
`node_modules` found; loading tree from disk...
┌────────────────┬───────┬──────────────────────────────────────────┐
│ publisher │ count │ packages │
├────────────────┼───────┼──────────────────────────────────────────┤
│ alice │ 3 │ [email protected] │
│ │ │ [email protected] │
│ │ │ [email protected] │
├────────────────┼───────┼──────────────────────────────────────────┤
│ bob │ 2 │ [email protected] │
│ │ │ [email protected] │
└────────────────┴───────┴──────────────────────────────────────────┘
> publishers publishers --json
{
"alice": [
{
"name": "a",
"publisher": {
"name": "alice",
"email": "[email protected]"
},
"version": "1.1.0"
},
{
"name": "b",
"publisher": {
"name": "alice",
"email": "[email protected]"
},
"version": "1.0.1"
},
{
"name": "c",
"publisher": {
"name": "alice",
"email": "[email protected]"
},
"version": "1.1.1"
},
],
"bob": [
{
"name": "d",
"publisher": {
"name": "bob",
"email": "[email protected]"
},
"version": "1.2.5"
},
{
"name": "e",
"publisher": {
"name": "bob",
"email": "[email protected]"
},
"version": "1.0.2"
}
]
}
API
const assert = require('assert');
const listPublishers = require('ls-publishers');
listPublishers('publishers').then(({ byPackage, byPublisher }) => {
assert.deepEqual(
byPublisher,
new Map([
['alice', new Set([
{
"name": "a",
"publisher": {
"name": "alice",
"email": "[email protected]"
},
"version": "1.1.0"
},
{
"name": "b",
"publisher": {
"name": "alice",
"email": "[email protected]"
},
"version": "1.0.1"
},
{
"name": "c",
"publisher": {
"name": "alice",
"email": "[email protected]"
},
"version": "1.1.1"
},
])],
['bob', new Set([
{
"name": "d",
"publisher": {
"name": "bob",
"email": "[email protected]"
},
"version": "1.2.5"
},
{
"name": "e",
"publisher": {
"name": "bob",
"email": "[email protected]"
},
"version": "1.0.2"
}
])],
])
);
}).catch((e) => {
console.error(e);
process.exit(1);
});