Registry / workflow / incremental-compiler

incremental-compiler

JSON →
library21.0.45jsnpmunverified

A library for building incremental compilers and file watchers in Node.js, version 21.0.45. It wraps @parcel/watcher and chokidar to provide a unified, event-driven API for watching file changes and triggering compilation. Supports TypeScript, project-based configuration, and automatically ignores node_modules and .git. Unlike raw chokidar, it abstracts away watcher differences and provides a base class for project-aware compilation.

npm install incremental-compiler
INSTALL
IMPORT
SIG · INCREMENTAL-COMPIL
I
incremental-compiler
workflowjavascriptv21.0.45
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.

BaseClientCompiler
import { BaseClientCompiler } from 'incremental-compiler/src'
import { BaseClientCompiler } from 'incremental-compiler'
Exports are from the 'src' subpath; top-level import will fail.
BaseClientCompilerOptions
import { BaseClientCompilerOptions } from 'incremental-compiler/src'
const { BaseClientCompilerOptions } = require('incremental-compiler')
Named export from src subpath; CJS require must use correct path.
incrementalWatcher
import { incrementalWatcher } from 'incremental-compiler/src'
import { incrementalWatcher } from 'incremental-compiler'
Same as above; all exports are in src/.

Demonstrates setting up a file watcher with incrementalWatcher that looks for .ts files and logs changes.

import { incrementalWatcher } from 'incremental-compiler/src'; async function watchAndCompile() { const watcher = await incrementalWatcher( ['src/**/*.ts', 'src/*.ts'], { name: 'TS Watcher', ignoreInitial: true } ); watcher.on('all', (event, filePath) => { console.log(`File ${event}: ${filePath}`); // trigger compilation }); } watchAndCompile();
Debug
Known issues
breakingExports are from 'incremental-compiler/src' subpath, not from the package root.
fix
Update all imports to use 'incremental-compiler/src' instead of 'incremental-compiler'.
affects: >=21.0.0
deprecatedBaseClientCompiler constructor signature changed: it now accepts options as second parameter.
fix
Pass options object as second argument to super().
affects: >=20.0.0
gotchanode_modules and .git directories are always ignored; cannot be overridden via options.
fix
Use a different watcher if you need to watch these directories.
affects: *
gotchaincrementalWatcher expects arrays of glob patterns, not single strings.
fix
Always wrap a single pattern in an array: ['pattern'].
affects: *
Errors
Common errors & fixes
Cannot find module 'incremental-compiler'
Importing from package root instead of 'incremental-compiler/src'.
fix
Change import to 'incremental-compiler/src'.
TypeError: incrementalWatcher is not a function
Incorrect import path or missing destructuring.
fix
Ensure you import as: import { incrementalWatcher } from 'incremental-compiler/src'.
Error: options must be an object
Second argument to incrementalWatcher is missing or not an object.
fix
Pass a valid options object as second argument, e.g., { name: 'my watcher' }.
Upgrade
Version history
21.0.45latest on npm
Audit
Dependencies
@parcel/watcherrequirednative file watching backend
chokidarrequiredfallback file watching backend
Agent activity
15 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
incremental-compiler — npm install incremental-compiler · libregistry