Documentation Index
Fetch the complete documentation index at: https://docs.scanoss.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, ensure you have:- Node.js 18 or higher
Join us in London for Infosecurity Europe June 2 – 4, 2026 | Booth C69 | Excel London | Get a FREE ticket
The SCANOSS JS SDK provides a JavaScript module for interacting with the SCANOSS API and scanning engine directly from your JavaScript projects.
Documentation Index
Fetch the complete documentation index at: https://docs.scanoss.com/llms.txt
Use this file to discover all available pages before exploring further.
npm install scanoss
// ES module
import { Scanner, ScannerEvents, ScannerCfg } from "scanoss";
// CommonJS
const { Scanner, ScannerEvents, ScannerCfg } = require("scanoss");
// Import the SCANOSS SDK using ES module syntax
import { Scanner, ScannerEvents } from "scanoss";
const scanner = new Scanner();
// Set the directory where scan results and fingerprints will be stored.
// If not set, the SDK will create a temporary folder with a timestamped name.
scanner.setWorkDirectory("/yourProjectFolder/ScanResults/");
// Triggered when the scan completes successfully
scanner.on(ScannerEvents.SCAN_DONE, (resultPath) => {
console.log("Scan complete. Results at:", resultPath);
});
// Outputs internal scanner log messages
scanner.on(ScannerEvents.SCANNER_LOG, (msg) => {
console.log(msg);
});
// Define the list of files to scan
const scannerInput = {
fileList: ["/yourProjectFolder/example1.c", "/yourProjectFolder/example2.c"],
};
// Start the scan.
// scanner.scan() returns a Promise and can be awaited,
// in addition to being observable via events.
await scanner.scan([scannerInput]);