Commit edf770f3 authored by Vladislav Bashkirev's avatar Vladislav Bashkirev

Add gendoc script and update README.md

Gendoc script generates docs using jsdoc and concatenates them with project description into README.md.
parent 558af21e
# Attachments Server Components
This repository provides components for building attachments server.
# Usage
Include module in your project using `npm`.
```
npm install --save attachments-components
```
and add this to your code
```
let components = require("attachments-components");
```
Object `module.exports` provides all necessary components.
This diff is collapsed. Click to expand it.
# Компоненты сервера вложений
# Attachments Server Components
Данный репозиторий хранит компоненты, необходимые для создания сервера вложений
This repository provides components for building attachments server.
# Использование
# Usage
Подключить модуль с помощью `npm`.
Include module in your project using `npm`.
```
let components = require("attachments-components");
npm install --save attachments-components
```
В module.exports модуля находятся все необходимые компоненты.
and add this to your code
```
let components = require("attachments-components");
```
Object `module.exports` provides all necessary components.
## Classes
<dl>
......@@ -126,7 +130,9 @@ attachments.
* [Ipfs](#Ipfs)
* [new Ipfs()](#new_Ipfs_new)
* [.pin(hash)](#Ipfs+pin)<code>Promise</code>
* [.serve(hash)](#Ipfs+serve)<code>Promise</code>
* [.unpin(hash)](#Ipfs+unpin)<code>Promise</code>
* [.upload(file)](#Ipfs+upload)<code>Promise</code>
<a name="new_Ipfs_new"></a>
......@@ -134,6 +140,18 @@ attachments.
### new Ipfs()
constructor for Ipfs class.
<a name="Ipfs+pin"></a>
### ipfs.pin(hash) ⇒ <code>Promise</code>
Stores an IPFS object from a given path locally to disk.
**Kind**: instance method of <code>[Ipfs](#Ipfs)</code>
**Returns**: <code>Promise</code> - Pinned object.
| Param | Type | Description |
| --- | --- | --- |
| hash | <code>String</code> | IPFS hash. |
<a name="Ipfs+serve"></a>
### ipfs.serve(hash) ⇒ <code>Promise</code>
......@@ -146,6 +164,19 @@ Serves attachment to the client.
| --- | --- | --- |
| hash | <code>String</code> | IPFS hash. |
<a name="Ipfs+unpin"></a>
### ipfs.unpin(hash) ⇒ <code>Promise</code>
Removes the pin from the given object allowing it to be garbage
collected if needed.
**Kind**: instance method of <code>[Ipfs](#Ipfs)</code>
**Returns**: <code>Promise</code> - Unpinned object.
| Param | Type | Description |
| --- | --- | --- |
| hash | <code>String</code> | IPFS hash. |
<a name="Ipfs+upload"></a>
### ipfs.upload(file) ⇒ <code>Promise</code>
......
#!/bin/bash
find ./components/ -type f -name "*.js" -print0 | xargs -0 ./node_modules/.bin/jsdoc2md > DOCS.md
cat DESC.md DOCS.md > README.md
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment