Celine119
Celine119

Reputation: 55

Execute shell commands in typescript

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

Upvotes: 4

Views: 4463

Answers (1)

Jeffrey Roosendaal
Jeffrey Roosendaal

Reputation: 7157

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.

Upvotes: 4

Related Questions