🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More →
Socket
Book a DemoSign in
Socket

nachos-packages

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nachos-packages

A package to manage all nachos packages

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
4
Created
Source

packages

Manage all nachos packages

LinuxOSXWindowsCoverageDependenciesDevDependencies
Coverage Status

Have a problem? Come chat with us!

Join the chat at https://gitter.im/nachos/packages

Installation

$ [sudo] npm install nachos-packages --save

Usage

Initialize

var packages = require('nachos-packages');

TYPES

Returns the available packages types

var types = packages.Packages.TYPES;

getFolderByType(type)

Get folder by specific type

packages.getFolderByType('dip')
  .then(function (folder) {
    // folder -> user/home/.nachos/packages/dips
  });

getFolderByPackage(packageName)

Get folder by specific package

packages.getFolderByPackage('your-package')
  .then(function (folder) {
    // folder -> user/home/.nachos/packages/type
  });

getPackage(packageName, [type])

Get specific package

By name

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

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

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

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

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

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

$ npm test

License

MIT

Keywords

nachos

FAQs

Package last updated on 18 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts