Registry / serialization / greyscript-transpiler

greyscript-transpiler

JSON →
library2.0.1jsnpmunverified

A TypeScript-based transpiler for GreyScript (Grey Hack MiniScript flavour), extending greybel-transpiler with GreyScript-specific AST parsing and code generation. Current stable version 2.0.1. Features three build modes (default, beautify, uglify), automatic dependency resolution, variable/module name obfuscation, environment variable injection, and installer output. Includes DirectTranspiler for single-file and full Transpiler for multi-file projects. Ships with TypeScript type definitions. Part of the greybel ecosystem.

npm install greyscript-transpiler
INSTALL
IMPORT
SIG · GREYSCRIPT-TRANSPI
G
greyscript-transpiler
serializationjavascriptv2.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 'greyscript-transpiler'
const DirectTranspiler = require('greyscript-transpiler').DirectTranspiler
Default export is not available; named import required. Supported in ESM and CJS.
Transpiler
import { Transpiler } from 'greyscript-transpiler'
const { Transpiler } = require('greyscript-transpiler').Transpiler
Named import; the class is exported as a named member.
BuildType
import { BuildType } from 'greyscript-transpiler'
import BuildType from 'greyscript-transpiler'
Enum-like object; must be named imported. Members: DEFAULT, BEAUTIFY, UGLIFY.
DirectTranspilerOptions
import type { DirectTranspilerOptions } from 'greyscript-transpiler'
import { DirectTranspilerOptions } from 'greyscript-transpiler'
TypeScript type import; use 'import type' for types to avoid runtime inclusion.

Shows how to transpile a single Greyscript string using DirectTranspiler with beautification and no obfuscation.

import { DirectTranspiler, BuildType } from 'greyscript-transpiler'; const transpiler = new DirectTranspiler({ code: 'print "hello world"', buildType: BuildType.BEAUTIFY, obfuscation: false }); const result = transpiler.parse(); console.log(result);
greybel --version
Debug
Known issues
breakingVersion 2.0.0 changed the API: Transpiler constructor now requires `target` instead of `code`; DirectTranspiler introduced for string input.
fix
Use DirectTranspiler for string code input; for file-based projects, pass `target` path to Transpiler.
affects: >=2.0.0
deprecatedDeprecation of `buildType` as a string; use BuildType enum imported from package.
fix
Replace string build type with enum: BuildType.DEFAULT, BuildType.BEAUTIFY, BuildType.UGLIFY.
affects: >=1.5.0 <2.0.0
gotchaObfuscation renames variables, which can break scripts that rely on variable names (e.g., for reflection).
fix
Disable obfuscation by setting `obfuscation: false` in options if variable names must be preserved.
affects: all
Errors
Common errors & fixes
Cannot find module 'greyscript-transpiler'
Package not installed or not in node_modules.
fix
Run `npm install greyscript-transpiler --save`
TypeError: transpiler.parse is not a function
Using Transpiler class without awaiting the promise; Transpiler.parse() is async and returns a Promise.
fix
Await the result: `const result = await transpiler.parse();`
Property 'DEFAULT' does not exist on type 'typeof BuildType'.
Attempted to use BuildType.DEFAULT without importing BuildType correctly.
fix
Import BuildType: `import { BuildType } from 'greyscript-transpiler'`; then use BuildType.DEFAULT.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
greybel-transpilerrequiredCore transpilation logic extended for GreyScript
greyscript-corerequiredGreyScript-specific AST types and helpers
Agent activity
10 hits · last 30 days
node
10
Resources
greyscript-transpiler — npm install greyscript-transpiler · libregistry