Registry / devops / chokibasic

chokibasic

JSON →
library1.1.11jsnpmunverified

A minimal build-and-watch utility wrapping chokidar, esbuild, sass, csso, and pxpros for simple static websites. Version 1.1.11 (2025) provides debounced file watchers, SCSS compilation + minification, JS bundling + minification, PHP template rendering via pxpros, sitemap generation, and dist export with .gitignore support. Unlike full-featured bundlers (Vite, Webpack), chokibasic is intentionally low-config and suited for small projects. ESM-only, ships TypeScript definitions, and has no runtime dependencies on the framework level (deps are bundled).

npm install chokibasic
INSTALL
IMPORT
SIG · CHOKIBASIC
C
chokibasic
devopsjavascriptv1.1.11
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.

createWatchers
import { createWatchers } from 'chokibasic'
const createWatchers = require('chokibasic').createWatchers
Package is ESM-only; using require() with destructuring will fail. Use dynamic import or set type: module.
buildCSS
import { buildCSS } from 'chokibasic'
const chokibasic = require('chokibasic'); chokibasic.buildCSS(...)
Named exports only; no default export exists.
buildJS
import { buildJS } from 'chokibasic'
import buildJS from 'chokibasic'
Default import is undefined; must use named import.

Sets up file watchers for SCSS and JS with automatic rebuild on change, plus graceful shutdown.

import { createWatchers, buildCSS, buildJS } from 'chokibasic'; const watcher = createWatchers([ { name: 'css', patterns: ['src/styles/**/*.scss'], callback: async (events) => { console.log('CSS changed:', events); await buildCSS('src/styles/main.scss', 'dist/app.min.css'); } }, { name: 'js', patterns: ['src/scripts/**/*.js'], ignored: ['**/*.min.js'], callback: async (events) => { console.log('JS changed:', events); await buildJS('src/scripts/main.js', 'dist/app.min.js'); } } ], { debug: true }); process.on('SIGINT', async () => { await watcher.close(); process.exit(0); });
chokibasic --version
Debug
Known issues
gotchacreateWatchers only watches 'change' events; 'add' and 'unlink' listeners are commented out in source.
fix
If you need 'add' or 'unlink' events, you must extend the watcher manually or fork the package.
affects: >=1.0.0
gotchaDefault options for buildCSS include `style: 'compressed'` and no sourcemaps, which may hide debugging information.
fix
Pass { sourceMap: true, style: 'expanded' } in options to get sourcemaps and expanded output.
affects: >=1.0.0
gotchabuildJS defaults to `platform: 'browser'` and `target: ['es2020']` — not suitable for Node.js or older browsers.
fix
Override platform and target in options, e.g., { platform: 'node', target: ['node14'] }.
affects: >=1.0.0
deprecatedThe `require()` usage shown in older documentation is incompatible with the current ESM-only distribution.
fix
Use ESM imports (import { ... } from 'chokibasic') or switch to dynamic import() inside CommonJS.
affects: >=1.1.0
gotchabuildPHP and buildSitemap require pxpros to be installed and configured separately; no default configuration is provided.
fix
Ensure pxpros is installed and configured (e.g., via a pxpros.config.js) before calling these functions.
affects: >=1.0.0
gotchaexportDist reads .gitignore from project root, but only respects basic patterns; complex negation rules may not work.
fix
Test with your .gitignore; consider using a dedicated tool like 'fdir' for more robust copying.
affects: >=1.0.0
breakingv1.1.0 switched from CommonJS to ESM, breaking all require() usage.
fix
Use import statements or set type: module in package.json and use import syntax.
affects: >=1.1.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module /path/to/node_modules/chokibasic/index.mjs not supported.
The package uses ES modules (exports .mjs or type: module) and cannot be require()'d in CommonJS.
fix
Use dynamic import: const { createWatchers } = await import('chokibasic'); or convert your project to ESM.
TypeError: chokibasic.createWatchers is not a function
Default import returns undefined because the package only exports named exports.
fix
Use named import: import { createWatchers } from 'chokibasic';
Error: Cannot find module 'pxpros'
pxpros is an optional peer dependency; it must be installed separately for buildPHP and buildSitemap to work.
fix
Run: npm install pxpros
SyntaxError: Unexpected token 'export'
The package is ESM-only, but the consuming environment (e.g., Node.js without type: module) expects CommonJS.
fix
Add "type": "module" to your package.json, or use .mjs extension for your entry file.
Upgrade
Version history
1.1.11latest on npm
Audit
Dependencies
chokidarrequiredFile watching engine used by createWatchers
sassrequiredSCSS compilation in buildCSS
cssorequiredCSS minification after sass compilation
esbuildrequiredJS bundling and minification in buildJS
pxprosrequiredPHP template rendering and sitemap generation (buildPHP, buildSitemap)
Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
1
Resources
chokibasic — npm install chokibasic · libregistry