mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add npm tests
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Test suite created by Maxime LUCE <https://github.com/SomaticIT>
|
||||
*
|
||||
* Created by using code samples from https://github.com/npm/npm#using-npm-programmatically.
|
||||
*/
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="npm.d.ts" />
|
||||
|
||||
import npm = require("npm");
|
||||
|
||||
npm.load({}, function (er) {
|
||||
if (er) {
|
||||
return console.error(er);
|
||||
}
|
||||
|
||||
npm.commands.install(["some", "args"], function (er, data) {
|
||||
if (er) {
|
||||
return console.error(er);
|
||||
}
|
||||
|
||||
// command succeeded, and data might have some info
|
||||
});
|
||||
|
||||
npm.on("log", function (message: string) {
|
||||
console.log(message);
|
||||
});
|
||||
})
|
||||
Reference in New Issue
Block a user