Registry / testing / spectral-cli-bundle

spectral-cli-bundle

JSON →
library1.0.8jsnpmunverified

Bundled version of @stoplight/spectral-cli v1.0.8 providing a self-contained executable for API linting with Spectral, pre-packaged to avoid external dependencies. Requires Node.js >=20. Released under MIT license, updated infrequently (last release 2023). Differentiator: single-file distribution, no need for npm install or separate Spectral CLI setup.

npm install spectral-cli-bundle
INSTALL
IMPORT
SIG · SPECTRAL-CLI-BUNDL
S
spectral-cli-bundle
testingjavascriptv1.0.8
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

spectral
import { spectral } from 'spectral-cli-bundle'
const spectral = require('spectral-cli-bundle')
ESM-only since v1.0.0; CommonJS require will fail.
Spectral
import { Spectral } from 'spectral-cli-bundle'
import { Spectral } from '@stoplight/spectral-cli'
Package re-exports all symbols from @stoplight/spectral-cli; use 'spectral-cli-bundle' as the import source.

Lints an OpenAPI specification file using Spectral CLI bundle and prints the exit code.

import { spectral } from 'spectral-cli-bundle'; const result = await spectral.run({ args: ['lint', '--format', 'stylish', 'api.yaml'], stdout: process.stdout, stderr: process.stderr }); console.log('Exit code:', result.exitCode);
spectral --version
Debug
Known issues
breakingpackage requires Node.js >=20, older versions will fail to run
fix
Upgrade Node.js to version 20 or later.
affects: <20
gotchaimport must be from 'spectral-cli-bundle' not '@stoplight/spectral-cli'
fix
Replace all imports from '@stoplight/spectral-cli' with 'spectral-cli-bundle'.
affects: >=1.0.0
gotchaCommonJS require() is not supported; use ESM import
fix
Convert require() to import statement or use dynamic import() if needed.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/spectral-cli-bundle/index.js from /path/to/file.js not supported.
Use of CommonJS require() with an ESM-only package.
fix
Use import instead: import { spectral } from 'spectral-cli-bundle'; or use dynamic import()
TypeError: Cannot read properties of undefined (reading 'run')
Imported from wrong package (e.g., '@stoplight/spectral-cli') instead of 'spectral-cli-bundle'.
fix
Change import source to 'spectral-cli-bundle'.
Upgrade
Version history
1.0.8latest on npm
Audit
Dependencies
@stoplight/spectral-clirequiredCore Spectral CLI functionality is bundled.
Agent activity
5 hits · last 30 days
node
4
Resources
spectral-cli-bundle — npm install spectral-cli-bundle · libregistry