# How to load a variable's file in serverless.ts

**URL:** <https://forum.serverless.com/t/how-to-load-a-variables-file-in-serverless-ts/18877>\
**Category:** Serverless Framework\
**Created:** [May 23, 2023, 9:02am UTC](https://forum.serverless.com/t/how-to-load-a-variables-file-in-serverless-ts/18877 "2023-05-23T09:02:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tarik](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Tarik](https://forum.serverless.com/u/Tarik)\
**Post date:** [May 23, 2023, 9:02am UTC](https://forum.serverless.com/t/how-to-load-a-variables-file-in-serverless-ts/18877/1 "2023-05-23T09:02:16Z")

</div>

In serverless.yaml we can load a env.json variable in this way

functions:  
hello:  
handler: handler.hello  
environment: ${file(env.json)}

how can we convert environment line on typescript

Thank you
