<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: udiko</title>
    <description>The latest articles on DEV Community by udiko (@udiko).</description>
    <link>https://dev.to/udiko</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F808040%2F73ee92a3-5205-499e-bde0-0d5febf1ce40.png</url>
      <title>DEV Community: udiko</title>
      <link>https://dev.to/udiko</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/udiko"/>
    <language>en</language>
    <item>
      <title>How to Run OpenHands with a Local LLM Using LM Studio</title>
      <dc:creator>udiko</dc:creator>
      <pubDate>Mon, 14 Apr 2025 01:46:09 +0000</pubDate>
      <link>https://dev.to/udiko/how-to-run-openhands-with-a-local-llm-using-lm-studio-41j6</link>
      <guid>https://dev.to/udiko/how-to-run-openhands-with-a-local-llm-using-lm-studio-41j6</guid>
      <description>&lt;p&gt;This guide will walk you through how to run &lt;a href="https://all-hands.dev" rel="noopener noreferrer"&gt;OpenHands&lt;/a&gt; locally and integrate it with &lt;a href="https://lmstudio.ai" rel="noopener noreferrer"&gt;LM Studio&lt;/a&gt;, a local language model interface. This setup lets you use OpenHands with an offline LLM, giving you a privacy-friendly and powerful AI development environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is OpenHands?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;OpenHands&lt;/strong&gt; is a visual development tool for building AI workflows, agents, and automation systems. It offers an intuitive UI to define complex AI interactions without writing code.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is LM Studio?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;LM Studio&lt;/strong&gt; is a desktop app that allows you to run large language models (LLMs) locally on your machine using GGUF (GPT-style) models. It supports models like Mistral, Qwen, Llama, etc., and exposes an OpenAI-compatible API to use those models with other apps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Run Both OpenHands and LM Studio Locally?
&lt;/h3&gt;

&lt;p&gt;Running both tools locally offers multiple advantages, especially in privacy-sensitive or regulated environments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Privacy &amp;amp; Security&lt;/strong&gt;&lt;br&gt;
Your prompts, code, and data never leave your machine—essential when working with confidential or proprietary information.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compliance with Security Policies&lt;/strong&gt;&lt;br&gt;
Some organizations do not allow sending code, user data, or logs to external APIs like OpenAI or Anthropic. Local setup helps you stay compliant.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Offline Development&lt;/strong&gt;&lt;br&gt;
You can work without internet access, which is helpful in restricted environments or when on the move.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cost&lt;/strong&gt;&lt;br&gt;
There's no pay-per-token usage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Custom Model Control&lt;/strong&gt;&lt;br&gt;
You can run models fine-tuned to your needs and switch between different LLMs as required.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Make sure you have the following installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.docker.com/products/docker-desktop/" rel="noopener noreferrer"&gt;Docker Desktop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://lmstudio.ai/" rel="noopener noreferrer"&gt;LM Studio&lt;/a&gt; (latest version recommended)&lt;/li&gt;
&lt;li&gt;A modern GPU or strong CPU for running large models locally (depending on your chosen model). In this guide, I'm using a MacBook Pro with an M1 Max chip and 32GB of RAM.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-by-Step Setup
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Create the Docker Compose file for running OpenHands locally&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Create a file named &lt;code&gt;docker-compose.yml&lt;/code&gt; with the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3.8"&lt;/span&gt;

&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;openhands-app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker.all-hands.dev/all-hands-ai/openhands:0.32&lt;/span&gt;
    &lt;span class="na"&gt;container_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;openhands-app&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;SANDBOX_RUNTIME_CONTAINER_IMAGE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker.all-hands.dev/all-hands-ai/runtime:0.32-nikolaik&lt;/span&gt;
      &lt;span class="na"&gt;LOG_ALL_EVENTS&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;true"&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3000:3000"&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;/var/run/docker.sock:/var/run/docker.sock&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;~/.openhands-state:/.openhands-state&lt;/span&gt;
    &lt;span class="na"&gt;extra_hosts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;host.docker.internal:host-gateway"&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;
    &lt;span class="na"&gt;pull_policy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. &lt;strong&gt;Start OpenHands&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Run the following command in your terminal from the same directory as the &lt;code&gt;docker-compose.yml&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker compose up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After a few moments, OpenHands will be running locally.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Open the OpenHands UI&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Visit the following URL in your browser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://localhost:3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Connect OpenHands to LM Studio
&lt;/h3&gt;

&lt;p&gt;Once OpenHands is running, you’ll need to configure it to use LM Studio as your local LLM provider. Lets install LLM first.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Install a Compatible LLM in LM Studio&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In LM Studio:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the &lt;strong&gt;"Models"&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Install a model with good coding capabilities. For Mac with 32GB a good one is: &lt;code&gt;qwen2.5-coder-14b-instruct&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Once installed, &lt;strong&gt;increase the context length&lt;/strong&gt; to &lt;code&gt;16384&lt;/code&gt; tokens in the model settings.&lt;/li&gt;
&lt;li&gt;Start the model and ensure it’s running on the &lt;strong&gt;OpenAI-compatible local server&lt;/strong&gt; (default port is &lt;code&gt;1234&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  5. &lt;strong&gt;Configure the LLM Provider in OpenHands&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In OpenHands:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on your avatar or settings menu.&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;"LLM Providers"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;"Advanced"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Model&lt;/strong&gt;: &lt;code&gt;lm_studio/qwen2.5-coder-14b-instruct&lt;/code&gt; OR follow the guide here to configure it: &lt;a href="https://docs.litellm.ai/docs/providers/lm_studio" rel="noopener noreferrer"&gt;LiteLLM - LM Studio Setup&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Base URL&lt;/strong&gt;: &lt;code&gt;http://LOCAL_IP:1234/v1&lt;/code&gt;
This tells the OpenHands container to connect to LM Studio running on your host machine.&lt;/li&gt;
&lt;li&gt;Click save.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  6. &lt;strong&gt;Authenticate with GitHub (If Using a Repo)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To pull a repo into OpenHands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the settings and connect your GitHub account.&lt;/li&gt;
&lt;li&gt;Add a &lt;strong&gt;GitHub Personal Access Token&lt;/strong&gt; with appropriate read access.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  7. &lt;strong&gt;Create a Project in OpenHands&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Go back to the main dashboard.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;“New Project”&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select a repository (if applicable).&lt;/li&gt;
&lt;li&gt;Open the workspace and start building with your offline LLM!&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OpenHands is in Early Stages&lt;/strong&gt;:&lt;br&gt;
OpenHands is still in its early development stages. While it's a promising tool, don’t expect a fully polished experience just yet. You may encounter occasional bugs or limitations as new features are added and refined.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Local LLM Limitations&lt;/strong&gt;:&lt;br&gt;
While running an LLM locally gives you more privacy and control, the performance and sophistication of locally-run models may not match the capabilities of cloud-based models like OpenAI or Anthropic. For tasks requiring advanced reasoning or up-to-date knowledge, cloud-based services might still be the better choice.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start Small with Clear Tasks&lt;/strong&gt;:&lt;br&gt;
It's best to focus on small, well-defined tasks when working with OpenHands and local LLMs. This helps avoid overwhelming the system and ensures that you can iterate and test your workflows more efficiently.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>openhands</category>
      <category>agents</category>
      <category>llm</category>
      <category>lmstudio</category>
    </item>
    <item>
      <title>vscode recommended extensions</title>
      <dc:creator>udiko</dc:creator>
      <pubDate>Tue, 24 May 2022 18:35:01 +0000</pubDate>
      <link>https://dev.to/udiko/vscode-recommended-extensions-5461</link>
      <guid>https://dev.to/udiko/vscode-recommended-extensions-5461</guid>
      <description>&lt;h3&gt;
  
  
  ESLint
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint"&gt;https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Path Intellisense
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense"&gt;https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Prettier
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode"&gt;https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vscode</category>
    </item>
    <item>
      <title>docx to pdf with Node.js</title>
      <dc:creator>udiko</dc:creator>
      <pubDate>Thu, 28 Apr 2022 13:03:30 +0000</pubDate>
      <link>https://dev.to/udiko/docx-to-pdf-with-nodejs-4jp1</link>
      <guid>https://dev.to/udiko/docx-to-pdf-with-nodejs-4jp1</guid>
      <description>&lt;p&gt;Most of the npms didnt works for me but this one do the job:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm i convert-multiple-files&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;convert.ts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { convertWordFiles } from 'convert-multiple-files';

const docToPdf = async (filePath: string, outputDir: string): Promise&amp;lt;string&amp;gt; =&amp;gt; await convertWordFiles(filePath, 'pdf', outputDir);

export {
    docToPdf
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;const outputFile = await docToPdf('file.docx', './outFolder');&lt;/code&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>docx</category>
      <category>pdf</category>
      <category>convert</category>
    </item>
    <item>
      <title>Migrate to typescript</title>
      <dc:creator>udiko</dc:creator>
      <pubDate>Sat, 23 Apr 2022 17:41:50 +0000</pubDate>
      <link>https://dev.to/udiko/migrate-to-typescript-12fp</link>
      <guid>https://dev.to/udiko/migrate-to-typescript-12fp</guid>
      <description>&lt;p&gt;To add typescript first you need to install the package&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm i typescript -g&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;tsc -v&lt;/code&gt; to see the typescript version&lt;/p&gt;

&lt;p&gt;Add configuration file &lt;code&gt;tsconfig.json&lt;/code&gt; to root folder of the project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "compilerOptions": {
      "outDir": "./built",
      "allowJs": true,
      "target": "es5"
    },
    "include": ["./src/**/*", "./tests/**/*"]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example the build includes src &amp;amp; tests folder, support commonjs and allow js files&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;tsc&lt;/code&gt; from console, after few seconds you will see the output files under &lt;strong&gt;built&lt;/strong&gt; folder&lt;/p&gt;

&lt;p&gt;Remove this folder from git by adding &lt;code&gt;built&lt;/code&gt; to &lt;code&gt;.gitignore&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;The built folder also annoying you on search, navigation etc.&lt;br&gt;
Its better to remove it from &lt;strong&gt;vs code&lt;/strong&gt; by adding&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; "files.exclude": {
        "built/": true
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to &lt;code&gt;.vscode/settings.json&lt;/code&gt; file&lt;/p&gt;

&lt;p&gt;Now, you can start convert your files gradually:&lt;/p&gt;

&lt;p&gt;Take one js file from your project &amp;amp; change the extension to ts (or tsx for jsx).&lt;/p&gt;

&lt;p&gt;Add ts syntax to the file to be sure you running right. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const testFunc = async (name) =&amp;gt; {
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const testFunc = async (name: string) =&amp;gt; {
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;run &lt;code&gt;tsc&lt;/code&gt; to see the output file&lt;/p&gt;

&lt;p&gt;Under development its better to run watcher that convert the ts files on-the-fly.&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;vs code&lt;/strong&gt; press &lt;code&gt;CTRL+SHIFT+B&lt;/code&gt; to choose one of the option:&lt;br&gt;
&lt;code&gt;tsc: build&lt;/code&gt; and &lt;code&gt;tsc: watch&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can watch the code and run in under &lt;code&gt;built&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;For build/tests configuration change the path to &lt;code&gt;built&lt;/code&gt; in &lt;code&gt;package.json&lt;/code&gt; file.&lt;/p&gt;
&lt;h3&gt;
  
  
  Adding serverless support
&lt;/h3&gt;

&lt;p&gt;If you are using sls to deploy the project Add this plugin to the project:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.serverless.com/plugins/serverless-plugin-typescript"&gt;Serverless Typescripts plugin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Put &lt;code&gt;- serverless-plugin-typescript&lt;/code&gt; at the top of plugins section: The order matter!&lt;/p&gt;

&lt;p&gt;One disadvantage for putting rendered js files on aws lambda its that you cant edit the code on Lambda &lt;strong&gt;Code source&lt;/strong&gt; section.&lt;/p&gt;
&lt;h3&gt;
  
  
  Converting Mocha framework to typescript
&lt;/h3&gt;

&lt;p&gt;install &lt;code&gt;npm i --save-dev @types/mocha&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Add for each test file &lt;code&gt;import 'mocha';&lt;/code&gt; so typescript will know describe, it etc.&lt;/p&gt;
&lt;h3&gt;
  
  
  ESLint
&lt;/h3&gt;

&lt;p&gt;You will have to run &lt;code&gt;npm init @eslint/config&lt;/code&gt; again for supporting typescript&lt;/p&gt;

&lt;p&gt;Example of config file &lt;code&gt;.eslintrc.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "env": {
        "es2021": true,
        "node": true
    },
    "extends": [
        "airbnb-base"
    ],
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "ecmaVersion": "latest",
        "sourceType": "module"
    },
    "plugins": [
        "@typescript-eslint"
    ],
    "rules": {
        "linebreak-style": "off",
        "import/extensions": "off",
        "import/no-unresolved": "off",
        "comma-dangle": "off",
        "indent": ["error", 4],
        "no-plusplus": "off",
        "no-promise-executor-return": "off",
        "no-await-in-loop": "off",
        "import/prefer-default-export": "off",
        "lines-between-class-members": "off",
        "max-len": ["error", 150]
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And adding to &lt;code&gt;package.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
    "lint": "eslint src/**/*.ts"
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running &lt;code&gt;npm run lint&lt;/code&gt; should execute the eslint with typescript support.&lt;/p&gt;

&lt;h3&gt;
  
  
  Debugging typescript
&lt;/h3&gt;

&lt;p&gt;Very useful tool is ts-node&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm i -D ts-node&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Running &lt;code&gt;ts-node index.ts&lt;/code&gt; will compile it on the fly &amp;amp; debugging act like regular javaScript &lt;/p&gt;

&lt;h3&gt;
  
  
  Copy Non JS files
&lt;/h3&gt;

&lt;p&gt;tsc will copy only js/ts files so if your project includes other files (xml, json etc.) you need to explicitly copy it:&lt;/p&gt;

&lt;p&gt;you can use npm for copy files:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm i -D copyfiles&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and adding post build stage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
"scripts": {
    "build": "tsc",
    "copyNonJsFiles": "copyfiles --error ./src/**/*.xml ./dist",
    "postbuild": "npm run copyNonJsFiles",
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;postbuild will run automatically after tsc&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>vscode</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Debug mocha tests with vscode</title>
      <dc:creator>udiko</dc:creator>
      <pubDate>Thu, 03 Feb 2022 10:40:33 +0000</pubDate>
      <link>https://dev.to/udiko/debug-mocha-tests-in-vscode-33a8</link>
      <guid>https://dev.to/udiko/debug-mocha-tests-in-vscode-33a8</guid>
      <description>&lt;p&gt;To debug &lt;strong&gt;mocha.js&lt;/strong&gt; in vscode select &lt;strong&gt;run &amp;amp; debug&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---YqkWyyJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/12ciymv6l1awzfoqbvud.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---YqkWyyJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/12ciymv6l1awzfoqbvud.png" alt="Image description" width="382" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you dont have launch.json file press &lt;strong&gt;create a launch.json file&lt;/strong&gt; for creating it.&lt;/p&gt;

&lt;p&gt;Press &lt;strong&gt;add configuration&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ih2Adb9M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gz42s2w7p524pynjz5tk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ih2Adb9M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gz42s2w7p524pynjz5tk.png" alt="Image description" width="374" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select &lt;strong&gt;Mocha Tests&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hbNONFdJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0qi82tyblvcl7aehm53.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hbNONFdJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0qi82tyblvcl7aehm53.png" alt="Image description" width="580" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The json should looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "args": [
                "-u",
                "tdd",
                "--timeout",
                "999999",
                "--colors",
                "${workspaceFolder}/test"
            ],
            "internalConsoleOptions": "openOnSessionStart",
            "name": "Mocha Tests",
            "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
            "request": "launch",
            "skipFiles": [
                "&amp;lt;node_internals&amp;gt;/**"
            ],
            "type": "pwa-node"
        },

        {
            "type": "pwa-node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "&amp;lt;node_internals&amp;gt;/**"
            ],
            "program": "${file}"
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add to "args":&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"--file",&lt;br&gt;
"${workspaceFolder}/test-folder/setup.js",&lt;br&gt;
"${workspaceFolder}/test-folder/**/*.spec.js",&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and run&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ecMyi-T3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9vqd7ydjl8sl5r3cua40.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ecMyi-T3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9vqd7ydjl8sl5r3cua40.png" alt="Image description" width="119" height="47"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you get &lt;strong&gt;Process exited with code 1&lt;/strong&gt; remove the&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "--require",
    "esm",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>mocha</category>
      <category>testing</category>
      <category>vscode</category>
    </item>
  </channel>
</rss>
