Skip to content

Commit a6e7357

Browse files
committed
Added Packages#install (#106)
1 parent 7a283d1 commit a6e7357

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/packages.js

+21
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,27 @@ export default class Packages {
333333
[...meta, ...configured].forEach(({name, args}) => this.launch(name, args || {}));
334334
}
335335

336+
/**
337+
* Installs a package
338+
* @param {string} url URL to package
339+
* @param {options} [options]
340+
* @param {boolean} [options.system] Install as system package
341+
*/
342+
install(url, options = {}) {
343+
const body = {
344+
url,
345+
options: Object.assign({}, {
346+
system: false
347+
}, options)
348+
};
349+
350+
return this.core
351+
.request('/api/packages/install', {
352+
method: 'post',
353+
body
354+
});
355+
}
356+
336357
/**
337358
* Registers a package
338359
*

0 commit comments

Comments
 (0)