Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nhz-io/nhz-io-graph
https://github.com/nhz-io/nhz-io-graph
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nhz-io/nhz-io-graph
- Owner: nhz-io
- License: mit
- Created: 2017-11-28T09:26:44.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-01T06:27:40.000Z (about 7 years ago)
- Last Synced: 2024-12-10T23:37:43.418Z (14 days ago)
- Language: CoffeeScript
- Size: 121 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Graph
[![Travis Build][travis]](https://travis-ci.org/nhz-io/nhz-io-graph)
[![Coverage][coveralls]](https://coveralls.io/github/nhz-io/nhz-io-graph)
[![NPM Version][npm]](https://www.npmjs.com/package/@nhz.io/graph)## Install
```bash
npm i -S @nhz.io/graph
```## Usage
This:
```js
const Graph = require('@nhz.io/graph')const graph = new Graph()
graph.setEdge ['node-1', 'node-2', 'edge-1']
graph.setEdge ['node-1', 'node-3', 'edge-2']console.log(JSON.stringify(graph, null, 2))
```Will produce:
```json
{
"id": "737e19e0-d447-11e7-901a-c91a9d397e30",
"nodes": [
"node-1",
"node-2",
"node-3"
],
"edges": [
[
"node-1",
"node-2",
"edge-1"
],
[
"node-1",
"node-3",
"edge-2"
]
]
}
```## Version 0.1.1
## License [MIT](LICENSE)
[travis]: https://img.shields.io/travis/nhz-io/nhz-io-graph.svg?style=flat
[npm]: https://img.shields.io/npm/v/@nhz.io/graph.svg?style=flat
[coveralls]: https://coveralls.io/repos/github/nhz-io/nhz-io-graph/badge.svg?branch=v0.1.1