jsii lets libraries authored in TypeScript or JavaScript expose native APIs in Python, Java, C#, Go, and other targets. It powers polyglot packages such as the AWS CDK from one source tree.
Overview
jsii is a toolchain that bridges JavaScript class libraries to multiple programming languages. Code in any supported language can interact with JavaScript classes as if they were native types, which enables a single TypeScript-authored library to ship idiomatic packages for TypeScript, JavaScript, Python, Java, C#, Go, and additional .NET-family languages.
Authors compile TypeScript modules through jsii to produce target-language packages that mirror the source API. Consumers import generated bindings and call methods on shared types—for example, a Greeter class with a greet method works the same way across listed languages in the documentation examples.
Runtime libraries for target languages, the .jsii assembly specification package, bindings generators, reflection utilities, and interactive configuration helpers ship together. JSON marshaling costs and lack of distributed garbage collection make jsii modules better suited to development and build tools than latency-sensitive runtime applications.
The AWS Cloud Development Kit is a flagship consumer: jsii enables CDK to deliver polyglot libraries from one codebase. User guides cover library authors, consumers, language implementers, and the formal specification.
Key features
- Polyglot bindings from TypeScript source
- Runtime libraries per target language
- .jsii assembly specification
- Bindings generator (jsii-pacmak)
- Assembly reflection utilities
- Interactive jsii package configuration
- Support for Python, Java, C#, Go
- CDK-style single-codebase publishing
Use cases
- Publishing multi-language SDKs from TypeScript
- AWS CDK construct libraries
- Build-time infrastructure tooling
- Shared APIs across .NET and other language stacks
- Authoring cross-language developer tools