Registry / devops / jflint

jflint

JSON →
library0.3.2jsnpmunverified

jflint is a CLI tool that helps lint a Declarative Jenkinsfile by wrapping the Jenkins Pipeline linting API. It sends the Jenkinsfile content to a specified Jenkins server and displays the validation result. The current stable version is 0.3.2. The tool supports Node.js v4–v7 (older versions). Unlike official Jenkins CLI methods (SSH/curl), jflint provides a simpler command-line interface, optional configuration file, and built-in handling of authentication and CSRF. It is a lightweight npm package with no external dependencies.

npm install jflint
INSTALL
IMPORT
SIG · JFLINT
J
jflint
devopsjavascriptv0.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

jflint
npx jflint Jenkinsfile
require('jflint')
jflint is a CLI tool, not a library. It should be invoked from the command line, not imported.

Shows install and run commands for jflint CLI tool, including global install, npx usage, and config file example.

// Install globally, then run $ npm install -g jflint $ jflint -j http://jenkins.example.com -u admin -p password /path/to/Jenkinsfile // Or use npx without install $ npx jflint -j http://jenkins.example.com -u admin -p password /path/to/Jenkinsfile // With config file .jflintrc { "jenkinsUrl": "http://jenkins.example.com", "username": "admin", "password": "p@ssword" } $ jflint /path/to/Jenkinsfile
jflint --version
Debug
Known issues
deprecatedNode.js >=4 required; Node.js versions 4-7 are end-of-life and insecure.
fix
Upgrade Node.js to a modern version (v12+), though jflint may not be actively maintained for newer Node.
affects: >=0.1.0
gotchajflint does not actually lint Jenkinsfiles locally; it sends the file to a Jenkins server for validation. A running Jenkins instance is required.
fix
Ensure a Jenkins server is accessible and the URL is correct.
affects: >=0.1.0
gotchaCredentials (username/password) are passed as command-line arguments, which can be visible in process lists or command history.
fix
Use the config file to avoid exposing credentials in command line, or set environment variables.
affects: >=0.1.0
breakingCSRF protection must be handled via --csrf-disabled flag if disabled; otherwise requests will fail.
fix
Specify --csrf-disabled if Jenkins CSRF protection is turned off, or configure Jekins to accept CSRF token.
affects: >=0.1.0
Errors
Common errors & fixes
Error: getaddrinfo ENOTFOUND
Invalid Jenkins URL or network issue.
fix
Check jenkinsUrl in config or -j option, ensure Jenkins is reachable.
HTTP 401 Unauthorized
Missing or incorrect username/password.
fix
Provide valid credentials via -u, -p, or config file.
HTTP 403 No valid crumb was included in the request
CSRF protection enabled but not handled.
fix
Use --csrf-disabled if CSRF is disabled, or generate a crumb token.
Upgrade
Version history
0.3.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
jflint — npm install jflint · libregistry