Registry / serialization / greybel-transpiler

greybel-transpiler

JSON →
library4.0.1jsnpmunverified

MiniScript transpiler written in TypeScript that converts MiniScript source files into deployable code with three build modes: default, beautify, and uglify. Version 4.0.1 supports automatic dependency resolution for #include and #import directives, variable/module namespace obfuscation, environment variable injection at transpile time, and literal deduplication. It offers both DirectTranspiler for quick single-file transpilation and Transpiler for full multi-file builds with dependency graphs and installer output. Built on greybel-core, it targets the MiniScript ecosystem and includes TypeScript type definitions.

npm install greybel-transpiler
INSTALL
IMPORT
SIG · GREYBEL-TRANSPILER
G
greybel-transpiler
serializationjavascriptv4.0.1
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.

DirectTranspiler
import { DirectTranspiler } from 'greybel-transpiler'
const DirectTranspiler = require('greybel-transpiler').DirectTranspiler
ESM and TypeScript import. CommonJS requires .DirectTranspiler property access.
Transpiler
import { Transpiler } from 'greybel-transpiler'
import Transpiler from 'greybel-transpiler'
Named export, not default. Use braces.
BuildType
import { BuildType } from 'greybel-transpiler'
import { BuildTypes } from 'greybel-transpiler'
Exact casing: BuildType, not BuildTypes.
greybel-transpiler
const greybel = require('greybel-transpiler')
No default export. Use named imports as above.

Shows basic usage of DirectTranspiler for single-file and Transpiler for multi-file project with obfuscation and env vars.

import { DirectTranspiler, BuildType } from 'greybel-transpiler'; const result = new DirectTranspiler({ code: 'print "hello world"', buildType: BuildType.BEAUTIFY, obfuscation: false }).parse(); console.log(result); // Or multi-file with Transpiler: import { Transpiler, BuildType } from 'greybel-transpiler'; const result2 = await new Transpiler({ target: '/path/to/main.src', buildType: BuildType.DEFAULT, obfuscation: true, installer: true, environmentVariables: new Map([['VERSION', '"1.0.0"']]) }).parse(); console.log(result2);
greybel --version
Debug
Known issues
gotchaDirectTranspiler does not resolve #include or #import dependencies; it only parses the given code string. Use Transpiler for dependency resolution.
fix
Use Transpiler with target file path instead of DirectTranspiler when needing dependency resolution.
affects: >=4.0.0
breakingVersion 4.x may have breaking changes from 3.x; check changelog for specific migration steps.
fix
Review greybel-transpiler changelog and update code accordingly.
affects: >=4.0.0
gotchaObfuscation is enabled by default in Transpiler? Verify the constructor option; if obfuscation is not set, it may default to true. The README example sets it explicitly.
fix
Always explicitly set obfuscation: false if you don't want variable name mangling.
affects: >=4.0.0
deprecatedBuildType enum values might change; ensure you use the string 'BuildType.BEAUTIFY' not deprecated string literals.
fix
Use imported BuildType enum, not hardcoded strings.
affects: >=4.0.0
Errors
Common errors & fixes
Cannot find module 'greybel-transpiler' or its corresponding type declarations.
Package not installed or not imported correctly.
fix
Run npm install greybel-transpiler. Use import { DirectTranspiler } from 'greybel-transpiler' with correct named export.
TypeError: DirectTranspiler is not a constructor
Default import used instead of named import.
fix
Use import { DirectTranspiler } from 'greybel-transpiler' instead of import DirectTranspiler from ...
Property 'BuildType' does not exist on type 'typeof import(...)'
Misspelled BuildType as BuildTypes or similar.
fix
Correct the import to { BuildType }.
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies
greybel-corerequiredCore library for MiniScript parsing and AST manipulation
Agent activity
2 hits · last 30 days
node
2
Resources
greybel-transpiler — npm install greybel-transpiler · libregistry