Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute shell commands in typescript

Is there a way to execute commands in Typescript, just like we do in Javascript with Shelljs Library?

like image 309
Celine119 Avatar asked Oct 18 '25 07:10

Celine119


1 Answers

You can use any javascript library in typescript, so shelljs should work too.

Typescript is a so called superset of javascript, which means it adds functionality to the javascript language. Therefore: all valid javascript is valid typescript (but not the other way around).


Install shelljs:

npm install --save shelljs

For extra convenience, you can add the @types for shelljs:

npm install --save @types/shelljs

Maybe you should take a look at Angular Universal, which runs server-side.

like image 139
Jeffrey Roosendaal Avatar answered Oct 20 '25 17:10

Jeffrey Roosendaal