Registry / devops / ts2c-target-gdbk-n

ts2c-target-gdbk-n

JSON →
library0.0.1jsnpmunverified

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'.

npm install ts2c-target-gdbk-n
INSTALL
IMPORT
SIG · TS2C-TARGET-GDBK-N
T
ts2c-target-gdbk-n
devopsjavascriptv0.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.

GPIO
import { GPIO } from 'ts2c-target-gdbk-n'
import GPIO from 'ts2c-target-gdbk-n'
Named export only; no default export.
SPI
import { SPI } from 'ts2c-target-gdbk-n'
const SPI = require('ts2c-target-gdbk-n').SPI
ESM-only; CommonJS require() fails with named exports.
I2C
import { I2C } from 'ts2c-target-gdbk-n'
const { I2C } = require('ts2c-target-gdbk-n')
ESM-only; require() may work in Node but not in browsers or the transpiler context.

Demonstrates basic GPIO output usage with the Led class decorator.

// ts2c-target-gdbk-n quickstart: blink LED on GPIO 2 import { GPIO } from 'ts2c-target-gdbk-n'; @GPIO({ pin: 2, mode: 'output' }) class Led { on() { /* compiler inserts C code */ } off() { /* compiler inserts C code */ } } const led = new Led(); led.on(); setTimeout(() => led.off(), 1000);
Debug
Known issues
breakingRequires ts2c >= 0.15.0; older versions not compatible.
fix
Update ts2c to >=0.15.0.
affects: <0.0.1
gotchaNo readme or documentation available; API surface may change without notice.
fix
Refer to ts2c documentation for general usage patterns.
affects: =0.0.1
gotchaAll exports are named; no default export exists.
fix
Use { GPIO, SPI, I2C } import syntax.
affects: >=0.0.1
gotchaPackage is ESM-only; CommonJS require() may fail in some environments.
fix
Use import statements with the transpiler which expects ESM.
affects: >=0.0.1
Errors
Common errors & fixes
Cannot find module 'ts2c-target-gdbk-n' or its corresponding type declarations.
Package not installed or missing from tsconfig includes.
fix
npm install ts2c-target-gdbk-n --save-dev
SyntaxError: Unexpected token 'export'
Using require() on ESM-only package.
fix
Switch to import statement in an ESM context.
TypeError: GPIO is not a function
Using default import instead of named import.
fix
Use import { GPIO } from 'ts2c-target-gdbk-n'
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies
ts2crequiredCore transpiler required for compilation to C
Agent activity
2 hits · last 30 days
node
2
Resources
ts2c-target-gdbk-n — npm install ts2c-target-gdbk-n · libregistry