Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Cloud Functions
  • Comparison with other Yandex Cloud services
    • All tutorials
    • Creating a skill for Alice
    • Deploying a web application
    • Creating a skill for Alice and a website with authorization
    • Writing data from a device into a database
    • Writing load balancer logs to PostgreSQL
    • Developing a Slack bot
    • Developing a Telegram bot
    • Connecting to a YDB database from a Python function
    • Connecting to a YDB database from a function in Node.js
    • Converting a video to a GIF in Python
    • Creating a Node.js function using TypeScript
    • Developing a custom integration
    • Creating a budget trigger that invokes a function to stop a VM
    • Creating an interactive serverless application using WebSocket
    • Automatically copying objects from one Object Storage bucket to another
    • Running computations on a schedule in DataSphere
    • Interactive debugging of functions
    • Regular asynchronous recognition of audio files from Object Storage
    • Canary release of a Cloud Functions function
    • Deploying a fault-tolerant architecture with preemptible VMs
    • Creating triggers that invoke a function to stop a VM and send a Telegram notification
    • Loading data from Yandex Direct to a data mart enabled by Yandex Managed Service for ClickHouse® using Yandex Cloud Functions, Yandex Object Storage, and Yandex Data Transfer
    • Status monitoring of geographically distributed devices
    • Sensor reading monitoring and event notifications
    • Emulating multiple IoT devices
    • Streaming Yandex Cloud Postbox events to Yandex Data Streams and analyzing them using Yandex DataLens
    • URL shortener
    • Yandex Tracker: data export and visualization
    • Running computations in DataSphere using the API
    • Developing a Telegram bot for text and audio recognition
    • Configuring responses in Yandex Cloud Logging and Cloud Functions
    • Developing functions in Functions Framework and deploying them to Yandex Serverless Containers
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ
  1. Tutorials
  2. Creating a Node.js function using TypeScript

Creating a Node.js function using TypeScript

Written by
vladd11
Updated at April 18, 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
Converting a video to a GIF in Python
Next
Developing a custom integration
Yandex project
© 2025 Yandex.Cloud LLC