The following example runs a scan using the default SCANOSS configuration:
// Import as ES6import { Scanner, ScannerEvents } from "scanoss";// Import as CommonJS// const { Scanner, ScannerEvents } = require('scanoss');const scanner = new Scanner();// Set the folder path where the module will save the scan results and fingerprints// If is not specified, the module will create a folder on tmp// directory using a timestamp as a namescanner.setWorkDirectory("/yourProjectFolder/ScanResults/");// Set the scanner log event handlerscanner.on(ScannerEvents.SCANNER_LOG, (logTxt) => console.log(logTxt));// Set the scanner finish event handlerscanner.on(ScannerEvents.SCAN_DONE, (resultPath) => { console.log("Path to results: ", resultPath);});const scannerInput = { fileList: ["/yourProjectFolder/example1.c"],};// Launch the scannerscanner.scan([scannerInput]);