← back to the blog


Set terminal title in package.json

Posted
on January 24th, 2019 in Javascript, nodejs by Chanoch

Well it turns out that you can easily do this if you can just remember a couple of switches and a couple of hex codes. Or...

You can use node-bash-title. It hides a single line js module but ....

  1. it's easy to remember and use
  2. you can add it to your scripts object to update the title on npm run dev

Install with

npm i -D node-bash-title

Add it to any package.json script by doing the following:

{
  ... rest of package.json
  "scripts": {
    "dev": "set-bash-title 'my custom title' && nodeman -r dotenv/config ... etc etc",
  }
}
d