SWC-registry-javascript
Javascript library for accessing an SWC-registry entries.
Installation
- Global installation:
npm install -g swc-registry
- Installation as dependency:
npm install --save swc-registry
Usage
import { SWC } from 'swc-registry';
const swc = new SWC();
const data = swc.getEntryData('SWC-100');
if (data) {
console.log(data.Title, data.Relationships, data.Description, data.Remediation);
} else {
throw new Error('Invalid SWC id');
}
CLI mode
Library provides swc-cli
executable for command-line interface. Usage examples:
- Print manual:
swc-cli --help
- Download latest SWC-registry JSON snapshot:
swc-cli --update
- View markdown of specific SWC entry:
swc-cli --markdown SWC-100