# chix-loader

> Definition Loader for Chiχ

Latest version **1.0.2** (published 2016-09-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install chix-loader
pnpm add chix-loader
yarn add chix-loader
bun add chix-loader
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-09-09 |
| First published | 2014-02-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Rob Halff |
| Maintainers | rhalff |
| Keywords | chix, loader |

## Links

- npm: https://www.npmjs.com/package/chix-loader
- Repository: https://github.com/psichi/chix-loader
- Homepage: https://github.com/psichi/chix-loader#readme
- Issues: https://github.com/psichi/chix-loader/issues
- npm.io page: https://npm.io/package/chix-loader

## Dependencies (5)

- [fbpx](https://npm.io/package/fbpx.md) ^1.x
- [glob](https://npm.io/package/glob.md) ^5.0.10
- [async](https://npm.io/package/async.md) ^1.2.0
- [debug](https://npm.io/package/debug.md) ^2.2.0
- [superagent](https://npm.io/package/superagent.md) ^1.2.0

## Recent versions

- 1.0.2 (latest) — 2016-09-09
- 1.0.1 — 2016-08-24
- 1.0.0 — 2016-08-07
- 0.5.0 — 2016-08-06
- 0.4.0 — 2016-01-02
- 0.3.1 — 2015-01-09
- 0.3.0 — 2015-01-09
- 0.2.4 — 2014-12-11
- 0.2.3 — 2014-12-10
- 0.2.2 — 2014-12-10
- 0.2.1 — 2014-11-18
- 0.2.0 — 2014-11-17
- 0.1.0 — 2014-11-09
- 0.0.12 — 2014-09-08
- 0.0.11 — 2014-04-12
- … 7 more at https://npm.io/package/chix-loader/versions

## README

Chiχ Loader
=========

[![Build Status](https://travis-ci.org/psichi/chix-loader.png)](https://travis-ci.org/psichi/chix-loader)

This is the base component loader for Chiχ.

χio uses node definitions to describe each of it's components.

The loader takes care from loading these definitions and caching them.

On top of the base loaders there are loaders which load the definitions from
a remote server or from the file system.

The base loader accepts definitions added manually.

Definitions are indexed by provider url, but the manual loader uses '@' to indicate
the definitions are local.

Example usage:
```javascript

var Loader = require('chix-loader');

var loader = new Loader();

loader.addNodeDefinitions('@', [{
  ns: 'my', name: 'component',
  ports: {
    input: {
      'in': {
          type: 'string'
      }
    },
    output: {
      out: {
          type: 'string'
        }
      }
    }
  }, {
    ns: 'my', name: 'component2',
    ports: { input: { in: { type: 'string' } } }
}]);

// retrieve a node definitions from a provider
loader.getNodeDefinitionFrom('@', 'my', 'component');

// Checks whether the definition is available
loader.hasNodeDefinition('@', 'my', 'component'); // true

// Given a node and it's map, will try and load the (remote) node.
// TODO: Explain provider structure within a map
loader.getNodeDefinition({
 ns: 'my',
 name: 'component'
}, map);

```

# collecting dependencies

It's also the loaders job to collect the dependencies needed to run a graph.
This is rather simple if a graph only contains non-composite nodes, but quickly
becomes more complex when subgraphs are used and the number of subgraphs are unknown.
The loader keeps track of which requires are needed.

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