TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: deemon, run a process in the background and attach to it

2 点作者 joaomoreno大约 5 年前

1 comment

joaomoreno大约 5 年前
Hi HN, author here!<p>We use deemon in VS Code to improve development and minimize downtime. As developers we like to run our build from within VS Code in order to get tasks support and get semantic errors in the Problems view. But since we often need to reload VS Code, this would kill the build task and we would need to start the build all over again which takes roughly 2-3 minutes to warm up. With deemon we are able to run the build from inside VS Code as a build task and later reattach to the same `yarn watch` process, even if we quit VS Code or reload it.<p>Deemon works similarly to running your build tasks inside tmux, detaching from it and later reattaching, but with a simpler interface. Instead of `yarn watch`, one runs instead `deemon yarn watch`.<p>Adopting it to the VS Code repo was as simple as adding a dev dependency to `deemon` and adding a new `watchd` script: <a href="https:&#x2F;&#x2F;github.com&#x2F;microsoft&#x2F;vscode&#x2F;blob&#x2F;4e8408d4c4dafae88f771691920bb54d7ab57c81&#x2F;package.json#L18" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;microsoft&#x2F;vscode&#x2F;blob&#x2F;4e8408d4c4dafae88f7...</a>.<p>You can try it out right now using `npx`: simply run `npx deemon BUILD COMMAND` (eg. `npx deemon yarn watch`). `Ctrl-C` will detach from the background process. Run the exact same command to reattach. `Ctrl-D` will terminate the background process.<p>Glad to answer any questions!