Skip to content
This repository was archived by the owner on Sep 30, 2023. It is now read-only.

Commit 6463365

Browse files
authored
Merge pull request #21 from adam-palazzo/feat/docs
Update Community Documentation
2 parents e5ce14b + c4b5b15 commit 6463365

File tree

4 files changed

+114
-7
lines changed

4 files changed

+114
-7
lines changed

CODE_OF_CONDUCT.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [community@orbitdb.org](mailto:community@orbitdb.org), which goes to all members of the @OrbitDB community team, or to [richardlitt@orbitdb.org](mailto:richardlitt@orbitdb.org), which goes only to [@RichardLitt](https://github.com/RichardLitt) or to [haadcode@orbitdb.org](mailto:haadcode@orbitdb.org), which goes only to [@haadcode](https://github.com/haadcode). All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.
2+
# Contribute
3+
4+
Please contribute! Here are some things that would be great:
5+
6+
- [Open an issue!](https://github.com/orbitdb/orbit-db-docstore/issues/new)
7+
- Open a pull request!
8+
- Say hi! :wave:
9+
10+
Please note that we have a [Code of Conduct](CODE_OF_CONDUCT.md), and that all activity in the [@OrbitDB](https://github.com/orbitdb) organization falls under it. Read it before you contribute, as being part of this community means that you agree to abide by it. Thanks.

README.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
# orbit-db-docstore
22

3+
[![npm](https://img.shields.io/npm/v/orbit-db-docstore.svg)](https://www.npmjs.com/package/orbit-db-docstore)
4+
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/orbitdb/Lobby)
5+
36
> Document Store for orbit-db
47
58
Database for storing indexed documents. Stores documents by `_id` field by default but you can also specify a custom field to index by.
69

710
*This is a core data store in [orbit-db](https://github.com/haadcode/orbit-db)*
811

12+
## Table of Contents
13+
14+
- [Install](#install)
15+
- [Usage](#usage)
16+
- [API](#api)
17+
- [docstore(name, options)](#docstorename-options)
18+
- [License](#license)
19+
920
## Install
1021

22+
This project uses [npm](https://npmjs.com) and [nodejs](https://nodejs.org)
23+
1124
```
1225
npm install orbit-db-docstore
1326
```
@@ -25,7 +38,7 @@ const docstore = orbitdb.docstore('db name')
2538
docstore.put({ _id: 'hello world', doc: 'all the things' })
2639
.then(() => docstore.put({ _id: 'sup world', doc: 'other things' }))
2740
.then(() => docstore.get('hello'))
28-
.then((value) => console.log(value))
41+
.then((value) => console.log(value))
2942
// [{ _id: 'hello world', doc: 'all the things'}]
3043

3144
```
@@ -38,7 +51,7 @@ const docstore = orbitdb.docstore('db name', { indexBy: 'doc' })
3851
docstore.put({ _id: 'hello world', doc: 'some things' })
3952
.then(() => docstore.put({ _id: 'hello universe', doc: 'all the things' }))
4053
.then(() => docstore.get('all'))
41-
.then((value) => console.log(value))
54+
.then((value) => console.log(value))
4255
// [{ _id: 'hello universe', doc: 'all the things'}]
4356

4457
```
@@ -52,7 +65,7 @@ docstore.put({ _id: 'hello world', doc: 'some things', views: 10 })
5265
.then(() => docstore.put({ _id: 'hello universe', doc: 'all the things', views: 100 }))
5366
.then(() => docstore.put({ _id: 'sup world', doc: 'other things', views: 5 }))
5467
.then(() => docstore.query((e)=> e.views > 5))
55-
.then((value) => console.log(value))
68+
.then((value) => console.log(value))
5669
// [{ _id: 'hello world', doc: 'some things', views: 10}, { _id: 'hello universe', doc: 'all the things', views: 100}]
5770
```
5871

@@ -62,7 +75,7 @@ docstore.put({ _id: 'hello world', doc: 'some things', views: 10 })
6275

6376
### docstore(name, options)
6477

65-
Package:
78+
Package:
6679
[orbit-db-docstore](https://github.com/shamb0t/orbit-db-docstore)
6780

6881
```javascript
@@ -79,14 +92,14 @@ docstore.put({ _id: 'hello world', doc: 'some things', views: 10 })
7992
```javascript
8093
db.put({ _id: 'QmAwesomeIpfsHash', name: 'shamb0t', followers: 500 }).then((hash) => ...)
8194
```
82-
95+
8396
- **get(key)**
8497
```javascript
8598
const profile = db.get('shamb0t')
8699
.map((e) => e.payload.value)
87100
// [{ _id: 'shamb0t', name: 'shamb0t', followers: 500 }]
88101
```
89-
102+
90103
- **query(mapper)**
91104
```javascript
92105
const all = db.query((doc) => doc.followers >= 500)
@@ -97,7 +110,7 @@ docstore.put({ _id: 'hello world', doc: 'some things', views: 10 })
97110
```javascript
98111
db.del('shamb0t').then((removed) => ...)
99112
```
100-
113+
101114
- **events**
102115

103116
```javascript
@@ -106,6 +119,12 @@ docstore.put({ _id: 'hello world', doc: 'some things', views: 10 })
106119

107120
See [events](https://github.com/haadcode/orbit-db/blob/master/API.md#events) for full description.
108121

122+
## Contributing
123+
124+
If you think this could be better, please [open an issue](https://github.com/orbitdb/orbit-db-docstore/issues/new)!
125+
126+
Please note that all interactions in @orbitdb fall under our [Code of Conduct](CODE_OF_CONDUCT.md).
127+
109128
## License
110129

111130
[MIT](LICENSE) ©️ 2015-2018 shamb0t, Haja Networks Oy

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"
88
},
9+
"keywords": [
10+
"orbitdb",
11+
"orbit-db"
12+
"docstore"
13+
],
914
"author": "shamb0t",
1015
"license": "MIT",
1116
"dependencies": {

0 commit comments

Comments
 (0)