I want to install typings from my build.js file.
For example, to install my bower deps I use:
var bower = require("bower");
bower.commands.install();
Is it possible to install typings that way?
I don't believe so, but as an alternative, you could probably get away with using child_process to run it.
If you have Typings installed globally, something along these lines should work:
var spawn = require("child_process").spawn;
var typings = spawn("typings", ["install"], { shell: true });
Or if you have it installed locally:
var spawn = require("child_process").spawn;
var typings = spawn("./node_modules/.bin/typings", ["install"], { shell: true });
I'd recommend reading the child_process docs to learn how to pipe the output from stdout/stderr to your build script - otherwise it'll run silently, I think.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With