> ## 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.

# SCANOSS-JS

> A comprehensive JavaScript library and CLI tool for Software Composition Analysis. Scan your code for open source components, dependencies and license compliance.

[SCANOSS JavaScript](https://github.com/scanoss/scanoss.js) provides a simple, easy-to-consume library for interacting with SCANOSS APIs and engines.

## Installation

### Standard Installation

Install SCANOSS-JS globally using npm:

```bash theme={null}
# Install from npm
npm install -g scanoss
```

### Project Installation

Install SCANOSS-JS as a dependency in your Node.js project:

```bash theme={null}
npm install scanoss
```

## Getting Started

### Basic Scanning

```bash theme={null}
# Scan a directory (output to console)
scanoss-js scan /path/to/folder

# Scan with JSON output file
scanoss-js scan -o results.json /path/to/folder

# Scan with dependency detection
scanoss-js scan --dependencies -o results.json /path/to/folder

# Scan with HTML report
scanoss-js scan --dependencies --format html -o report.html /path/to/folder
```

### Viewing Results

```bash theme={null}
# View JSON results
cat results.json

# View HTML report in browser
# Windows (Git Bash/PowerShell)
start report.html

# macOS
open report.html

# Linux
xdg-open report.html
```

## Configuration

### Configuring API Access

By default, SCANOSS uses the SCANOSS OSS Knowledge Base API at `https://api.osskb.org` (no API key required).

To use a different endpoint or API key:

```bash theme={null}
# Via command line
scanoss-js scan --apiurl https://api.scanoss.com --key <your-api-key> -o results.json /path/to/folder
```
