Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Tutorials
    • All tutorials
    • URL shortener
    • Ingesting data into storage systems
    • Storing application runtime logs
    • Deploying a web application using the Java Servlet API
    • Developing a Slack bot
    • Developing a Telegram bot
    • Developing a Telegram bot with AI agent support
    • Developing a custom integration in API Gateway
    • Developing CRUD APIs for movie services
    • Building a CI/CD pipeline in GitLab
    • GitLab Runner execution in Serverless Containers
    • Configuring CI/CD between Cloud Functions and SourceCraft
    • Configuring CI/CD between Cloud Functions and GitHub
    • Setting up CI/CD in SourceCraft to deploy an application in Serverless Containers using GitHub Actions
    • Working with an API gateway via WebSocket
    • Building an interactive serverless application using WebSocket
    • Automatically copying objects from one Object Storage bucket to another
    • Visualizing logs in Grafana using the Cloud Logging plugin
    • Canary release of Cloud Functions
    • Interactive debugging of Cloud Functions
    • Creating a Node.js function using TypeScript
    • Running a containerized app in Serverless Containers
    • Streaming Yandex Cloud Postbox events to Data Streams and analyzing them with DataLens
    • Using API Gateway to set up speech synthesis in SpeechKit
    • Connecting to YDB from a Cloud Functions function in Python
    • Connecting to a YDB database from a Cloud Functions function in Node.js
    • API Gateway protection with Smart Web Security
    • Deploying a web app with JWT authorization in API Gateway and authentication in Firebase
    • Automatic data upload to Yandex SpeechSense using Yandex Workflows
    • Configuring responses in Cloud Logging and Yandex Cloud Functions
    • Setting up Workflows integration with Tracker, YandexGPT, and Yandex Cloud Postbox
    • Developing functions in Functions Framework and deploying them to Yandex Serverless Containers
    • Creating a Yandex Cloud Postbox address and checking domain ownership with Terraform
    • Creating an AI agent with Yandex Cloud Functions
    • Configuring Postfix to send emails via Yandex Cloud Postbox
    • Yandex Cloud Postbox integration with external systems via webhooks
  1. Serverless technologies
  2. Creating a Node.js function using TypeScript

Creating a Node.js function using TypeScript

Written by
vladd11
Updated at July 15, 2025

By default, Node.js does not support TypeScript. Before uploading TypeScript code to Cloud Functions, you need to compile it in JavaScript.

  1. Install Node.js.

  2. Open your project directory.

  3. Install TypeScript:

    npm install typescript --save-dev
    
  4. Create a TypeScript configuration:

    npx --no-install tsc --init --preserveConstEnums --moduleResolution Node --isolatedModules --outDir build --strict false --target ES2021
    

    To use a different version of JavaScript, change the value of the target argument. The latest JavaScript version that can be specified depends on the Node.js version you are using:

    Node.js version Highest JavaScript version
    12 ES2019
    14 ES2020
    16 ES2021
  5. Compile a function:

    npx tsc
    
  6. The build directory will appear in the project folder. Add its contents to a ZIP archive.

  7. Create a function.

  8. Create a function version.

Was the article helpful?

Previous
Interactive debugging of Cloud Functions
Next
Running a containerized app in Serverless Containers
© 2025 Direct Cursus Technology L.L.C.