Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dependency-viewer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dependency-viewer

View package dependencies across projects

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by700%
Maintainers
1
Weekly downloads
 
Created
Source

Node.js CI

Dependency viewer across nodejs projects

  • 1. Support
  • 2. Install
  • 3. Usage
  • 4. API

1. Support

Currently the project has support for:

  • Gitlab
  • Github
  • Bitbucket

2. Install

npm install dependency-viewer

3. Usage

const Gitlab = require('./lib/wrappers/Gitlab');
const GraphBuilder = require('./lib/GraphBuilder');

const gitlab = new Gitlab('organization', { token: 'super-secret-token' });
const graphBuilder = new GraphBuilder(gitlab);

graphBuilder.buildDependencyGraph({
  wrapperOptions: {
    excludeProjects: [],
    packageInclude: '',
    packagePrefix: '',
  },
}).then(async (dependencyGraphs) => {
  // do something with your dependecy graphs
});

4. API

Classes

GraphBuilder

GraphBuilder builds the dependency graph given a wrapper

GitlabWrapper

GitlabWrapper implements all the communication with Gitlab api

Wrapper

Wrapper extend it when implementing a Wrapper

GraphBuilder

GraphBuilder builds the dependency graph given a wrapper

GraphBuilder

new GraphBuilder(wrapper)

Create new GraphBuilder

ParamType
wrapperWrapper

graphBuilder.buildDependencyGraph(wrapperOptions) ⇒ Object

build the dependency graph

Kind: instance method of GraphBuilder

Returns: Object - all dependencies {allDepsGraph, proDepsGraph, devDepsGraph }

ParamType
wrapperOptionsObject

GitlabWrapper

GitlabWrapper implements all the communication with Gitlab api

GitlabWrapper

new GitlabWrapper([organization], options)

Create new GitlabWrapper

ParamTypeDefaultDescription
[organization]String''name of organization
optionsObjectoptions object
[options.protocol]Stringhttpsprotocol to be used
[options.domain]Stringgitlab.comdomain to be used
options.tokenStringtoken from Gitlab

gitlabWrapper.getAllPackages(options) ⇒ Object

Get all package.json from gitlab projects

Kind: instance method of GitlabWrapper

Returns: Object - All dependencies objects

ParamTypeDefaultDescription
optionsObjectoptions object
[options.excludeProjects]Array.<String>[]array of strings representing projects to exclude
[options.packagePrefix]String''inlcude packages that have this prefix in their name. Useful for organization packages
[options.packageInclude]String''include packages that contain this this in their name

Wrapper

Wrapper extend it when implementing a Wrapper

wrapper.getAllPackages(options)

Kind: instance method of Wrapper

ParamTypeDescription
optionsObjectoptions object
options.excludeProjectsArray.<String>array of strings representing projects to exclude
options.packagePrefixStringinlcude packages that have this prefix in their name. Useful for organization packages
options.packageIncludeStringinclude packages that contain this this in their name

FAQs

Package last updated on 22 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc