Registry / devops / modpe-compiler

modpe-compiler

JSON →
library0.1.0jsnpmunverified

A build tool that integrates linting (ESLint), transpilation (Babel), and minification (UglifyJS) for ModPE scripts used in the BlockLauncher Minecraft modding platform. Version 0.1.0 is the current stable release, likely with low release cadence. It differs from general transpilers by targeting the ModPE runtime environment specifically, providing a single-command pipeline for legacy ModPE JavaScript development.

npm install modpe-compiler
INSTALL
IMPORT
SIG · MODPE-COMPILER
M
modpe-compiler
devopsjavascriptv0.1.0
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.

ModPECompiler
const ModPECompiler = require('modpe-compiler');
import ModPECompiler from 'modpe-compiler';
The package uses CommonJS; ES import syntax may not work depending on bundler.
new ModPECompiler(filePath)
let compiler = new ModPECompiler('your_script.js');
let compiler = new modpeCompiler.ModPECompiler('your_script.js');
Constructor exported directly, not as a named property.
compiler.run()
compiler.run();
ModPECompiler.run('your_script.js');
run() is an instance method, not static.

Shows how to instantiate ModPECompiler, run lint/transpile/minify pipeline, and save output.

const ModPECompiler = require('modpe-compiler'); let compiler = new ModPECompiler('./my_script.js'); try { compiler.run(); compiler.saveAsFile(); console.log('Compiled successfully'); } catch (err) { console.error('Compilation failed:', err); }
Debug
Known issues
gotchaESM import syntax is not supported natively; only CommonJS require works.
fix
Use const ModPECompiler = require('modpe-compiler');
affects: <=0.1.0
gotchaInput file must be valid JavaScript; no error reporting for missing files beyond generic message.
fix
Check file path exists before calling constructor.
affects: <=0.1.0
deprecatedESLint, Babel, and UglifyJS are outdated dependencies; may have security vulnerabilities.
fix
Use alternative tools that are actively maintained.
affects: <=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'uglify-js'
Missing optional dependency; UglifyJS is expected but not a direct dependency.
fix
Install manually: npm install uglify-js
TypeError: compiler.run is not a function
Using default import syntax with ES import; ModPECompiler is the default, but run is not a static method.
fix
Instantiate first: new ModPECompiler().run()
Error: ENOENT: no such file or directory, open '...'
File path provided does not exist.
fix
Verify the file path passed to the constructor.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

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