Registry / devops / module-compiler

module-compiler

JSON →
library0.0.7jsnpmunverified

A KISSY module compiler tool that converts Java-style module builds to Node.js. Version 0.0.7 is the latest release; the package appears stable but has not been updated recently. It provides a config-based approach to bundle KISSY modules, supporting package configuration, path mapping, and charset encoding. Unlike generic bundlers, it is specifically tailored for the KISSY ecosystem, offering API methods config() and build() for input/output file processing.

npm install module-compiler
INSTALL
IMPORT
SIG · MODULE-COMPILER
M
module-compiler
devopsjavascriptv0.0.7
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.

ModuleComplier
import { ModuleComplier } from 'module-compiler'
const ModuleComplier = require('module-compiler').ModuleComplier
Note the package exports ModuleComplier as a named export; also note the typo 'Complier' in the package (should be 'Compiler').
ModuleComplier
const { ModuleComplier } = require('module-compiler')
const ModuleComplier = require('module-compiler')
CommonJS destructuring to access the named export; direct require yields an object, not the class itself.
config
ModuleComplier.config(cfg)
ModuleComplier.config({ cfg })
config() expects a plain object, not a wrapped object. This is a method on ModuleComplier.

This example demonstrates configuring a KISSY package and building a module file using ModuleCompiler.

const { ModuleComplier } = require('module-compiler'); ModuleComplier.config({ packages: [{ name: 'myapp', path: '/absolute/path/to/myapp', charset: 'utf-8' }], map: [], suffix: '.combine', charset: 'utf-8' }); ModuleComplier.build('input.js', 'output.combine.js');
Debug
Known issues
gotchaPackage name is 'module-compiler' but the exported symbol is named 'ModuleComplier' (typo: 'Complier' instead of 'Compiler'). This can cause confusion when searching for documentation.
fix
Use the exact symbol name 'ModuleComplier' as exported. Do not expect 'ModuleCompiler'.
affects: 0.0.7
gotchaThe package has not been updated since the initial release; it is likely in maintenance mode with no active development.
fix
Consider using a more modern and actively maintained module bundler for KISSY or general purposes.
affects: >=0.0.0
breakingThe build() method expects absolute paths for input and output files; relative paths may fail depending on the working directory.
fix
Always provide absolute paths or resolve them using path.resolve() before passing to build().
affects: >=0.0.0
gotchaThe config method's 'packages' option expects an array of objects with specific properties; it is not strictly validated and can silently ignore invalid entries.
fix
Follow KISSY package configuration format: { name, path, charset }.
affects: >=0.0.0
Errors
Common errors & fixes
ModuleComplier is not a constructor
Incorrect import; the module exports an object with ModuleComplier as a property, not the class directly.
fix
Use const { ModuleComplier } = require('module-compiler'); or destructure correctly.
Cannot find module 'tbuild'
The documentation incorrectly suggests requiring 'tbuild'; the actual package name is 'module-compiler'.
fix
Use require('module-compiler') instead of require('tbuild').
TypeError: ModuleComplier.config is not a function
Probably imported the wrong symbol or the object has no config method. Ensure you have the correct import and that config() is called on the ModuleComplier object.
fix
Verify with console.log(ModuleComplier) that the object has a config method.
Upgrade
Version history
0.0.7latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
module-compiler — npm install module-compiler · libregistry