{"id":25661,"library":"greyscript-transpiler","title":"greyscript-transpiler","description":"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.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/ayecue/greyscript-transpiler","tags":["javascript","greyscript","greyhack","typescript"],"install":[{"cmd":"npm install greyscript-transpiler","lang":"bash","label":"npm"},{"cmd":"yarn add greyscript-transpiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add greyscript-transpiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core transpilation logic extended for GreyScript","package":"greybel-transpiler","optional":false},{"reason":"GreyScript-specific AST types and helpers","package":"greyscript-core","optional":false}],"imports":[{"note":"Default export is not available; named import required. Supported in ESM and CJS.","wrong":"const DirectTranspiler = require('greyscript-transpiler').DirectTranspiler","symbol":"DirectTranspiler","correct":"import { DirectTranspiler } from 'greyscript-transpiler'"},{"note":"Named import; the class is exported as a named member.","wrong":"const { Transpiler } = require('greyscript-transpiler').Transpiler","symbol":"Transpiler","correct":"import { Transpiler } from 'greyscript-transpiler'"},{"note":"Enum-like object; must be named imported. Members: DEFAULT, BEAUTIFY, UGLIFY.","wrong":"import BuildType from 'greyscript-transpiler'","symbol":"BuildType","correct":"import { BuildType } from 'greyscript-transpiler'"},{"note":"TypeScript type import; use 'import type' for types to avoid runtime inclusion.","wrong":"import { DirectTranspilerOptions } from 'greyscript-transpiler'","symbol":"DirectTranspilerOptions","correct":"import type { DirectTranspilerOptions } from 'greyscript-transpiler'"}],"quickstart":{"code":"import { DirectTranspiler, BuildType } from 'greyscript-transpiler';\n\nconst transpiler = new DirectTranspiler({\n  code: 'print \"hello world\"',\n  buildType: BuildType.BEAUTIFY,\n  obfuscation: false\n});\n\nconst result = transpiler.parse();\nconsole.log(result);\n","lang":"typescript","description":"Shows how to transpile a single Greyscript string using DirectTranspiler with beautification and no obfuscation."},"warnings":[{"fix":"Use DirectTranspiler for string code input; for file-based projects, pass `target` path to Transpiler.","message":"Version 2.0.0 changed the API: Transpiler constructor now requires `target` instead of `code`; DirectTranspiler introduced for string input.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Replace string build type with enum: BuildType.DEFAULT, BuildType.BEAUTIFY, BuildType.UGLIFY.","message":"Deprecation of `buildType` as a string; use BuildType enum imported from package.","severity":"deprecated","affected_versions":">=1.5.0 <2.0.0"},{"fix":"Disable obfuscation by setting `obfuscation: false` in options if variable names must be preserved.","message":"Obfuscation renames variables, which can break scripts that rely on variable names (e.g., for reflection).","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `npm install greyscript-transpiler --save`","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'greyscript-transpiler'"},{"fix":"Await the result: `const result = await transpiler.parse();`","cause":"Using Transpiler class without awaiting the promise; Transpiler.parse() is async and returns a Promise.","error":"TypeError: transpiler.parse is not a function"},{"fix":"Import BuildType: `import { BuildType } from 'greyscript-transpiler'`; then use BuildType.DEFAULT.","cause":"Attempted to use BuildType.DEFAULT without importing BuildType correctly.","error":"Property 'DEFAULT' does not exist on type 'typeof BuildType'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}