{"id":27474,"library":"ts2c-target-gdbk-n","title":"TS2C ESP-GDBK-N Target","description":"A target package for the TS2C transpiler (v0.15.0+, monthly releases) that compiles TypeScript to C for the ESP-GDBK-N microcontroller. Provides board-specific hardware abstractions (GPIO, SPI, I2C) as TypeScript decorators. Differentiates from Arduino by allowing TypeScript-to-C transpilation, enabling type-safe embedded development. No readme available; usage inferred from peer package 'ts2c'.","status":"active","version":"0.0.1","language":"javascript","source_language":"en","source_url":"git://github.com/andrei-markeev/ts2c-target-gdbk-n","tags":["javascript","typescript"],"install":[{"cmd":"npm install ts2c-target-gdbk-n","lang":"bash","label":"npm"},{"cmd":"yarn add ts2c-target-gdbk-n","lang":"bash","label":"yarn"},{"cmd":"pnpm add ts2c-target-gdbk-n","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core transpiler required for compilation to C","package":"ts2c","optional":false}],"imports":[{"note":"Named export only; no default export.","wrong":"import GPIO from 'ts2c-target-gdbk-n'","symbol":"GPIO","correct":"import { GPIO } from 'ts2c-target-gdbk-n'"},{"note":"ESM-only; CommonJS require() fails with named exports.","wrong":"const SPI = require('ts2c-target-gdbk-n').SPI","symbol":"SPI","correct":"import { SPI } from 'ts2c-target-gdbk-n'"},{"note":"ESM-only; require() may work in Node but not in browsers or the transpiler context.","wrong":"const { I2C } = require('ts2c-target-gdbk-n')","symbol":"I2C","correct":"import { I2C } from 'ts2c-target-gdbk-n'"}],"quickstart":{"code":"// ts2c-target-gdbk-n quickstart: blink LED on GPIO 2\nimport { GPIO } from 'ts2c-target-gdbk-n';\n\n@GPIO({ pin: 2, mode: 'output' })\nclass Led {\n  on() { /* compiler inserts C code */ }\n  off() { /* compiler inserts C code */ }\n}\n\nconst led = new Led();\nled.on();\nsetTimeout(() => led.off(), 1000);\n","lang":"typescript","description":"Demonstrates basic GPIO output usage with the Led class decorator."},"warnings":[{"fix":"Update ts2c to >=0.15.0.","message":"Requires ts2c >= 0.15.0; older versions not compatible.","severity":"breaking","affected_versions":"<0.0.1"},{"fix":"Refer to ts2c documentation for general usage patterns.","message":"No readme or documentation available; API surface may change without notice.","severity":"gotcha","affected_versions":"=0.0.1"},{"fix":"Use { GPIO, SPI, I2C } import syntax.","message":"All exports are named; no default export exists.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use import statements with the transpiler which expects ESM.","message":"Package is ESM-only; CommonJS require() may fail in some environments.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install ts2c-target-gdbk-n --save-dev","cause":"Package not installed or missing from tsconfig includes.","error":"Cannot find module 'ts2c-target-gdbk-n' or its corresponding type declarations."},{"fix":"Switch to import statement in an ESM context.","cause":"Using require() on ESM-only package.","error":"SyntaxError: Unexpected token 'export'"},{"fix":"Use import { GPIO } from 'ts2c-target-gdbk-n'","cause":"Using default import instead of named import.","error":"TypeError: GPIO is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}