Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Latest commit

 

History

History
47 lines (35 loc) · 1.06 KB

NodeSecureDataSet.md

File metadata and controls

47 lines (35 loc) · 1.06 KB

NodeSecureDataSet

Class to load, parse and format NodeSecure scanner payload.

const secureDataSet = new NodeSecureDataSet();

// Init by searching payload and flags on a remote API
await secureDataSet.init();

// Init by providing payload and flags
await secureDataSet.init(payload, window.FLAGS);

The .build() method will return Vis.js nodes and edges DataSet.

const { nodes, edges } = secureDataSet.build();

The method is automatically called in NodeSecureNetwork class constructor

Constructor options

The class allow you to ignore flags and/or warnings at initialization.

const secureDataSet = new NodeSecureDataSet({
  flagsToIgnore: ["🌲"],
  warningsToIgnore: ["unsafe-regex", "encoded-literal", "unsafe-stmt"]
});

Data

The .init() method hydrate a lot of properties of the class.

this.warnings = [];
this.packages = [];
this.linker = new Map();
this.authors = new Map();
this.extensions = Object.create(null);
this.licenses = { Unknown: 0 };
this.dependenciesCount = 0;
this.size = 0;
this.indirectDependencies = 0;