Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Introduction

jsii allows code in any language to naturally interact withJavaScript classes. It is the technology that enablestheAWS Cloud Development Kit to deliver polyglot libraries from a single codebase!

A class library written inTypeScript can be used in projects authored inTypeScript orJavascript (asusual), but also inC# (and other languages from the.NET family),Go,Java,Python, ... Morelanguages will be added in the future!

Warning

Due toJSON marshaling costs and the absence of a distributed garbage collector feature,jsii modules are bestsuited for development and build tools, as opposed to performance-sensitive or resource-constrained applications.

SeeRuntime Architecture for more information.

An example is worth a thousand words

Consider the followingTypeScript class:

/** * A simple greeter, hello world style. */exportclassGreeter{/**   * Greets the designated person.   *   * @param name the person to greet.   *   * @returns a greeting.   */publicgreet(name:string){return`Hello,${name}!`;}}

By compiling our source module usingjsii, we can now package it as modules in one of the supported target languages.Each target module has the exact same API as the source. This allows users of that target language to useGreeter likeany other native type:

vargreeter=newGreeter();greeter.Greet("World");// => Hello, World!
greeter:=NewGreeter()greeter.Greet("World")// => Hello, World!
finalGreetergreeter=newGreeter();greeter.greet("World");// => Hello, World!
constgreeter=newGreeter();greeter.greet("World");// => Hello, World!
greeter=Greeter()greeter.greet("World")# => Hello, World!

How to use this website

The documentation in this website is separated in different topics, which can be navigated using links in the site'sheader bar:

  • TheWelcome section provides a high level overview ofjsii.
  • TheUser Guides section includes the following:

    • TheLibrary Author Guide is intended for developers who are looking to author libraries usingjsii to enable polyglot support for their work.
    • TheLibrary Consumer Guide is intended for developers who are consuming libraries generated byjsii in the various supported target languages.
    • TheLanguage Implementation is intended for developers who are looking to add support for a newtarget language injsii.
  • TheSpecification provides detailed information on the internal components ofjsii.

  • TheArchitecture Decision Records contains the log of all architectural decisions made while developing thejsii project.

How to contribute

Thejsii project welcomes all kind of contributions. You can refer to theContribution Guide on GitHub to get more information about howto contribute to the project in general.

Tip

You can submit pull requests for documentation updates without leaving the comfort of your web browser!

All pages of this website have a icon on the top right of each page that links to a GitHub webeditor for the source of the page in question.

2025-03-17

[8]ページ先頭

©2009-2025 Movatter.jp