Manage all nachos packages
Linux | OSX | Windows | Coverage | Dependencies | DevDependencies |
---|---|---|---|---|---|
$ [sudo] npm install nachos-packages --save
var packages = require('nachos-packages');
Returns the available packages types
var types = packages.Packages.TYPES;
Get folder by specific type
packages.getFolderByType('dip')
.then(function (folder) {
// folder -> user/home/.nachos/packages/dips
});
Get folder by specific package
packages.getFolderByPackage('your-package')
.then(function (folder) {
// folder -> user/home/.nachos/packages/type
});
Get specific package
packages.getPackage('your-package')
.then(function (packageConfig) {
/** packageConfig:
{
path: 'path/to/your/package',
type: 'package-type',
config: { ... } // -> nachos.json of the package
}
*/
});
packages.getPackage('your-package', 'dip')
.then(function (packageConfig) {
/** packageConfig:
{
path: 'path/to/your/package',
config: { ... } // -> nachos.json of the package
}
*/
});
Get all packages with specific type
packages.getByType('dip')
.then(function (packagesByType) {
/** packagesByType:
[
{
name: 'pkg1',
path: 'path/to/your/package'
},
...
]
*/
});
// With 'full' option
packages.getByType('dip', true)
.then(function (packagesByType) {
/** packagesByType:
[
{
name: 'pkg1',
path: 'path/to/your/package',
config: { ... } // -> nachos.json of the package
},
...
]
*/
});
Get dip by name
packages.getDip('your-dip')
.then(function (dipConfig) {
/** dipConfig:
{
path: 'path/to/your/dip',
config: { ... } // -> nachos.json of the package
}
*/
});
Get taco by its name
packages.getTaco('your-taco')
.then(function (tacoConfig) {
/** tacoConfig:
{
path: 'path/to/your/taco',
config: { ... } // -> nachos.json of the package
}
*/
});
Get all packages of all types
packages.getAll()
.then(function (packages) {
/** packages
{
dip: [
{
name: 'pkg1',
path: 'path/to/your/package'
},
...
],
taco: [...]
}
*/
});
// With 'full' option
packages.getAll(true)
.then(function (packages) {
/** packages
{
dip: [
{
name: 'pkg1',
path: 'path/to/your/package',
config: { ... } // -> nachos.json of the package
},
...
],
taco: [...]
}
*/
});
$ npm test