Bhaskar Jyoti Dutta
Bhaskar Jyoti Dutta

Reputation: 1800

Can I write cloud functions for firebase both in javaScript and typeScript?

I have already deployed some 4 or 5 functions to firebase using JavaScript. But now I want to use async-await in my 2 functions. So I want to convert these 2 functions to TypeScript. Is it possible? If I change .js to .ts do the other functions work well which are in js

Upvotes: 9

Views: 1501

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317487

All JavaScript is valid TypeScript. TypeScript is a superset of JavaScript.

You should be able to simply change you .js files to .ts to see them work immediately. Then, you can add in TypeScript specific code as you see fit.

Upvotes: 16

Related Questions