Registry / devops / lint-and-publish

lint-and-publish

JSON →
library0.0.8jsnpmunverified

A tool to prevent unnecessary npm publishes in CI/CD by checking if code changes actually warrant a new version. v0.0.8, frequently updated. Unlike standard npm publish, it validates whether a publish is needed, avoiding noisy failures. Ships TypeScript types. Primarily for Node.js/CI environments.

npm install lint-and-publish
INSTALL
IMPORT
SIG · LINT-AND-PUBLISH
L
lint-and-publish
devopsjavascriptv0.0.8
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.

default
import lintAndPublish from 'lint-and-publish'
const lintAndPublish = require('lint-and-publish')
ESM-only; no CJS support. Default export is a function.
init
import { init } from 'lint-and-publish'
Named export for the CLI init command.
LintOptions
import type { LintOptions } from 'lint-and-publish'
TypeScript type for configuration options.

Shows how to import and use lint-and-publish to check if publish is needed before actually publishing.

import lintAndPublish from 'lint-and-publish'; import { init } from 'lint-and-publish'; // Initialize configuration init(); // Use to check and publish if needed lintAndPublish({ checkOnly: true, registry: 'https://registry.npmjs.org/', token: process.env.NPM_TOKEN ?? '' });
lint-and-publish --version
Debug
Known issues
gotchaDefault export is an async function, must be awaited
fix
Use await lintAndPublish(...)
affects: >=0.0.1
deprecatedCLI --init flag is deprecated, use init() programmatically
fix
Call init() from code
affects: >=0.0.7
breakingv0.0.8 changed default export from object to function
fix
Update import: import fn from 'lint-and-publish' instead of import { publish } from 'lint-and-publish'
affects: >=0.0.8
Errors
Common errors & fixes
Error: Cannot find module 'lint-and-publish'
Package not installed
fix
Run npm install lint-and-publish
TypeError: lintAndPublish is not a function
Using default import without awaiting async function
fix
Add await: await lintAndPublish(...)
Error: No such file or directory for .lint-publish.json
Configuration file not created
fix
Run npx lint-and-publish --init or call init()
Upgrade
Version history
0.0.8latest on npm
Audit
Dependencies
typescriptoptionaldev dependency for type definitions
Agent activity
2 hits · last 30 days
node
2
Resources
lint-and-publish — npm install lint-and-publish · libregistry