From f11166531d79b5c4ea5c4109f765738899b099cf Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 1 Oct 2018 06:29:48 +0400 Subject: Added description Signed-off-by: Valentin Popov --- README.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/README.md b/README.md index e69de29..0c5efec 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,87 @@ +# GitHub Library + +A small library for personal use. + +* Build the package: + +```bash +npm run-script build +``` + +* Testing the package: + +```bash +npm run-script test +``` + +## API + +### Github.addComment( target, comment ) ⇒ `Undefined` + +| Param | Type | Default | Description | +| --------- | --------- | ------------- | ----------------- | +| `target` | `String` | `document` | Selector object | +| `comment` | `Object` | | Comment data | + +Adding a comment to a template. + +Example: + +```javascript +window.addEventListener("load", function () { + Github.getComments("octocat/Hello-World", 1, + function (error, comments) { + if (error) { throw new Error(error); } + // code + }); +}); +``` + +### Github.getComments( repos, issue, callback ) ⇒ `Array` + +| Param | Type | Default | Description | +| ------------- | ------------- | --------- | ----------------- | +| `repos` | `String` | | Repository name | +| `issue` | `Number` | | Issue number | +| `callback` | `Function` | | Function handler | + +Getting a list of comments. + +Example: + +```html + + + + + +``` + +## License + +MIT License + +[MIT](LICENSE.txt). +Copyright (c) +[Valentin Popov](https://valentineus.link/). -- cgit v1.2.3