TS2C ESP-IDF Target

raw JSON →
0.0.1 verified Fri May 01 auth: no javascript

A target module for the TS2C transpiler that enables converting TypeScript to C code for ESP-IDF (Espressif IoT Development Framework). As of version 0.0.1, it is a very early release with no known release cadence. Differentiates from other transpilation approaches by targeting embedded systems directly from TypeScript, but is in an experimental stage with limited documentation and likely breaking changes.

error Cannot find module 'ts2c-target-esp-idf'
cause Package not installed or not in node_modules
fix
Run npm install ts2c-target-esp-idf
error Target 'esp-idf' is not recognized
cause Incorrect import or target usage
fix
Ensure you import the target and pass it as an object to ts2c.transpile()
breaking Version 0.0.1 is highly experimental; APIs are not stable and will change without notice.
fix Pin to exact version and test upgrades carefully.
deprecated No known deprecated features yet due to early stage.
fix N/A
gotcha Package may not have a README, making setup instructions unclear. Rely on ts2c core documentation.
fix Refer to ts2c documentation and source code for target usage.
npm install ts2c-target-esp-idf
yarn add ts2c-target-esp-idf
pnpm add ts2c-target-esp-idf

Basic usage of ts2c-target-esp-idf to transpile TypeScript to C for ESP-IDF environment.

import ts2c from 'ts2c';
import espIdfTarget from 'ts2c-target-esp-idf';

const code = ts2c.transpile({
  target: espIdfTarget,
  input: 'path/to/typescript.ts',
  output: 'path/to/output.c'
});

console.log('Transpiled successfully');