🚀 DAY 1 OF LAUNCH WEEK: Reachability for Ruby Now in Beta.Learn more
Socket
Book a DemoInstallSign in
Socket

typenative

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typenative

Build native applications using Typescript.

latest
Source
npmnpm
Version
0.0.14
Version published
Maintainers
1
Created
Source

TypeNative

Build native applications using Typescript.

PreRequisites

  • Nodejs v20 or newer.
  • Go 1.21 or newer.

Get Started

  • Write a file test.ts with content console.log('Hello World!'); or any other message
  • Run npx typenative --source test.ts --script
  • See your message in the terminal

Create a TypeNative Project

  • Run npx typenative --new
  • Give your project a name
  • Start writing code

Typescript Syntax Support

TypeNative currently supports a subset of TypeScript syntax elements that are transpiled to Go code:

FeatureSupportedNotes
Basic Types
numberTranspiled to float64
booleanTranspiled to bool
string
null
anyUsed for type inference
Variables
Variable declarationslet and const
Operators
Arithmetic operators+, -, etc.
Comparison operators==, !=, etc.
Logical operators&&, ||
Increment/Decrement++, --
Control Flow
For loopsStandard for loops
For...of loopsIteration over arrays
While loopsTranspiled to Go's for loops
Do...while loopsImplemented with conditional break
If/Else statementsFully supported
Switch statementsCase and default statements
Data Structures
ArraysBasic array operations
Array methodspush supported
Functions
Function declarationsTranspiled to Go functions
Arrow FunctionsTranspiled to anonymous functions
console.logMapped to fmt.Println
console.time/timeEndPerformance measurement
Math.randomMapped to Go's rand.Float64()
Math.floorMapped to Go's math.Floor()
Unsupported Features
ClassesNot implemented
InterfacesNot implemented
Async/AwaitNot implemented
Modules/ImportsNot implemented
GenericsNot implemented

TypeNative is currently in early development and new features are being added regularly.

FAQs

Package last updated on 25 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts