# nachos-packages

> A package to manage all nachos packages

Latest version **1.2.0** (published 2015-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install nachos-packages
pnpm add nachos-packages
yarn add nachos-packages
bun add nachos-packages
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2015-08-18 |
| First published | 2015-07-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nachos team |
| Maintainers | noamokman, eladbezalel, omrilitov, amirschl |
| Keywords | nachos, packages |

## Links

- npm: https://www.npmjs.com/package/nachos-packages
- Repository: https://github.com/nachos/packages
- Issues: https://github.com/nachos/packages/issues
- npm.io page: https://npm.io/package/nachos-packages

## Dependencies (7)

- [q](https://npm.io/package/q.md) ^1.4.1
- [debug](https://npm.io/package/debug.md) ^2.2.0
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [jsonfile](https://npm.io/package/jsonfile.md) ^2.2.1
- [fs-access](https://npm.io/package/fs-access.md) ^1.0.0
- [nachos-home](https://npm.io/package/nachos-home.md) ^1.0.1
- [nachos-config](https://npm.io/package/nachos-config.md) ^1.0.0

## Recent versions

- 1.2.0 (latest) — 2015-08-18
- 1.1.0 — 2015-08-14
- 1.0.1 — 2015-07-28
- 1.0.0 — 2015-07-28

## README

# packages

Manage all nachos packages

<table>
  <thead>
    <tr>
      <th>Linux</th>
      <th>OSX</th>
      <th>Windows</th>
      <th>Coverage</th>
      <th>Dependencies</th>
      <th>DevDependencies</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td colspan="2" align="center">
        <a href="https://travis-ci.org/nachos/packages"><img src="https://img.shields.io/travis/nachos/packages.svg?style=flat-square"></a>
      </td>
      <td align="center">
        <a href="https://ci.appveyor.com/project/nachos/packages"><img src="https://img.shields.io/appveyor/ci/nachos/packages.svg?style=flat-square"></a>
      </td>
      <td align="center">
<a href='https://coveralls.io/r/nachos/packages'><img src='https://img.shields.io/coveralls/nachos/packages.svg?style=flat-square' alt='Coverage Status' /></a>
      </td>
      <td align="center">
        <a href="https://david-dm.org/nachos/packages"><img src="https://img.shields.io/david/nachos/packages.svg?style=flat-square"></a>
      </td>
      <td align="center">
        <a href="https://david-dm.org/nachos/packages#info=devDependencies"><img src="https://img.shields.io/david/dev/nachos/packages.svg?style=flat-square"/></a>
      </td>
    </tr>
  </tbody>
</table>

## Have a problem? Come chat with us!
[![Join the chat at https://gitter.im/nachos/packages](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nachos/packages?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## Installation
``` bash
$ [sudo] npm install nachos-packages --save
```

## Usage
### Initialize
``` js
var packages = require('nachos-packages');
```

### TYPES
Returns the available packages types
``` js
var types = packages.Packages.TYPES;
```

### getFolderByType(type)
Get folder by specific type
``` js
packages.getFolderByType('dip')
  .then(function (folder) {
    // folder -> user/home/.nachos/packages/dips
  });
```

### getFolderByPackage(packageName)
Get folder by specific package
``` js
packages.getFolderByPackage('your-package')
  .then(function (folder) {
    // folder -> user/home/.nachos/packages/type
  });
```

### getPackage(packageName, [type])
Get specific package
#### By name
``` js
packages.getPackage('your-package')
  .then(function (packageConfig) {
    /** packageConfig: 
        {
          path: 'path/to/your/package',
          type: 'package-type',
          config: { ... } // -> nachos.json of the package
        }
    */
  });
```

#### By name and type
``` js
packages.getPackage('your-package', 'dip')
  .then(function (packageConfig) {
    /** packageConfig: 
        {
          path: 'path/to/your/package',
          config: { ... } // -> nachos.json of the package
        }
    */
  });
```

### getByType(type, [full])
Get all packages with specific type
``` js
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
          },
          ...
        ]
    */
  });
```

### getDip(dipName)
Get dip by name
``` js
packages.getDip('your-dip')
  .then(function (dipConfig) {
    /** dipConfig: 
        {
          path: 'path/to/your/dip',
          config: { ... } // -> nachos.json of the package
        }
    */
  });
```

### getTaco(tacoName)
Get taco by its name
``` js
packages.getTaco('your-taco')
  .then(function (tacoConfig) {
    /** tacoConfig: 
        {
          path: 'path/to/your/taco',
          config: { ... } // -> nachos.json of the package
        }
    */
  });
```

### getAll([full])
Get all packages of all types
``` js
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: [...]
        }
    */
  });
```


## Run Tests
``` bash
$ npm test
```

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/nachos-packages · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
