docs: Using distributed OrbitDB script.

This commit is contained in:
Hayden Young 2023-07-08 12:47:24 +01:00
parent 04ec34ad8a
commit d7cfdf96ed
4 changed files with 10 additions and 4 deletions

View File

@ -38,9 +38,9 @@ A Go implementation is developed and maintained by the [Berty](https://github.co
<!-- toc -->
- [Installation](#installation)
* [Browser <script> tag](#browser-script-tag)
- [Usage](#usage)
- [API](#api)
- [Database browser UI](#database-browser-ui)
- [Examples](#examples)
* [Install dependencies](#install-dependencies)
* [Browser example](#browser-example)
@ -64,6 +64,12 @@ A Go implementation is developed and maintained by the [Berty](https://github.co
npm install orbit-db
```
### Browser <script> tag
OrbitDB can be loaded in the browser using the distributed js file with the `<script/>` tag. OrbitDB is the global namespace and all external functions are available via this namespace:
`<script>/path/to/orbitdb.min.js</script>`
## Usage
If you're using `orbit-db` to develop **browser** or **Node.js** applications, use it as a module with the javascript instance of IPFS.

View File

@ -7,7 +7,7 @@ export default (env, argv) => {
return {
mode: 'production',
entry: './src/orbitdb.js',
entry: './src/index.js',
output: {
filename: '../dist/orbitdb.min.js',
library: {

View File

@ -7,7 +7,7 @@ export default (env, argv) => {
return {
mode: 'development',
entry: './src/orbitdb.js',
entry: './src/index.js',
output: {
filename: '../dist/orbitdb.js',
library: {

View File

@ -9,7 +9,7 @@
* const ipfs = create()
* const orbitdb = await OrbitDB({ ipfs })
* const db = await orbitdb.open('my-docs', { Database: Documents({ indexBy: 'myCustomId'} ) }
*
*
* @augments module:Databases~Database
*/
import Database from '../database.js'