Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
docs: publish api docs (#20)
Browse files Browse the repository at this point in the history
Update config to publish api docs
  • Loading branch information
achingbrain authored Dec 16, 2022
1 parent ab544aa commit 61446e1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
node_modules
coverage
.nyc_output
dist
.docs
.coverage
package-lock.json
yarn.lock
docs
dist
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,34 @@
[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-tracked-map.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-tracked-map)
[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-tracked-map/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-tracked-map/actions/workflows/js-test-and-release.yml)
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-tracked-map/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p-tracked-map/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)

> Allows tracking of statistics while libp2p is running
## Table of contents <!-- omit in toc -->

- [Install](#install)
- [Browser `<script>` tag](#browser-script-tag)
- [Description](#description)
- [Example](#example)
- [API Docs](#api-docs)
- [License](#license)
- [Contribute](#contribute)
- [Contribution](#contribution)

## Install

```console
$ npm i @libp2p/tracked-map
```

### Browser `<script>` tag

Loading this module through a script tag will make it's exports available as `Libp2pTrackedMap` in the global namespace.

```html
<script src="https://unpkg.com/@libp2p/tracked-map/dist/index.min.js"></script>
```

## Description

A map that reports it's size to the libp2p [Metrics](https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-interfaces/src/metrics#readme) system.
Expand All @@ -37,13 +47,17 @@ const map = trackedMap<string, string>({ metrics })
map.set('key', 'value')
```

## API Docs

- <https://libp2p.github.io/js-libp2p-tracked-map>

## License

Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

## Contribute
## Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"types": "./dist/src/index.d.ts",
"files": [
"src",
"dist/src",
"dist",
"!dist/test",
"!**/*.tsbuildinfo"
],
Expand Down Expand Up @@ -135,14 +135,15 @@
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
"test:node": "aegir test -t node --cov",
"test:electron-main": "aegir test -t electron-main",
"release": "aegir release"
"release": "aegir release",
"docs": "aegir docs"
},
"dependencies": {
"@libp2p/interface-metrics": "^4.0.0"
},
"devDependencies": {
"aegir": "^37.0.7",
"sinon": "^14.0.0",
"sinon": "^15.0.1",
"sinon-ts": "^1.0.0"
}
}

0 comments on commit 61446e1

Please sign in to comment.