# Getting Started

It's possible to use TypeDI without TypesScript, however some of the functionality is limited or not available. These differences are listed below in the [Limitations](#limitations) section.

## Installation

To start using TypeDI with JavaScript install it via NPM:

```bash
npm install typedi
```

## Basic usage

The most basic usage is to request an instance of a class definition. TypeDI will check if an instance of the class has been created before and return the cached version or it will create a new instance, cache and return it.

```js
import { Container } from 'typedi';

class ExampleClass {
  print() {
    console.log('I am alive!');
  }
}

/** Request an instance of ExampleClass from TypeDI. */
const classInstance = Container.get(ExampleClass);

/** We received an instance of ExampleClass and ready to work with it. */
classInstance.print();
```

For more advanced usage examples and patterns please read the [next page](/typedi/usage-without-typescript/usage/02-basic-usage.md).

## Limitations

*To be written...*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.typestack.community/typedi/usage-without-typescript/01-getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
