Skip to content

Commit

Permalink
deps(dev): update aegir and it-pushable (#44)
Browse files Browse the repository at this point in the history
Updates project config and readme
  • Loading branch information
achingbrain authored Jul 26, 2022
1 parent f0aad8d commit a67205e
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 31 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ updates:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
commit-message:
prefix: "deps"
prefix-development: "deps(dev)"
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
# it-length-prefixed
# it-length-prefixed <!-- omit in toc -->

[![Build Status](https://github.com/alanshaw/it-length-prefixed/actions/workflows/js-test-and-release.yml/badge.svg?branch=master)](https://github.com/alanshaw/it-length-prefixed/actions/workflows/js-test-and-release.yml)
[![Dependencies Status](https://david-dm.org/alanshaw/it-length-prefixed/status.svg)](https://david-dm.org/alanshaw/it-length-prefixed)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![codecov](https://img.shields.io/codecov/c/github/alanshaw/it-length-prefixed.svg?style=flat-square)](https://codecov.io/gh/alanshaw/it-length-prefixed)
[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/alanshaw/it-length-prefixed/actions/workflows/js-test-and-release.yml)

> Streaming length prefixed buffers with async iterators
> Streaming length prefixed buffers with async iterables
## Table of contents <!-- omit in toc -->

- [Install](#install)
- [Usage](#usage)
- [API](#api)
- [`encode([opts])`](#encodeopts)
- [`encode.single(chunk, [opts])`](#encodesinglechunk-opts)
- [`decode([opts])`](#decodeopts)
- [`decode.fromReader(reader, [opts])`](#decodefromreaderreader-opts)
- [Contribute](#contribute)
- [License](#license)
- [Contribution](#contribution)

## Install

```sh
npm install it-length-prefixed
```console
$ npm i it-length-prefixed
```

## Usage
Expand Down Expand Up @@ -86,7 +98,7 @@ Returns a [transform](https://gist.github.com/alanshaw/591dc7dd54e4f99338a347ef5

- `chunk: Buffer|Uint8ArrayList` chunk to encode
- `opts: Object`, optional
- `lengthEncoder: Function`: See description above. Note that this encoder will _not_ be passed a `target` or `offset` and so will need to allocate a buffer to write to.
- `lengthEncoder: Function`: See description above. Note that this encoder will *not* be passed a `target` or `offset` and so will need to allocate a buffer to write to.

Returns a `Uint8ArrayList` containing the encoded chunk.

Expand Down Expand Up @@ -122,4 +134,11 @@ PRs and issues gladly accepted! Check out the [issues](https://github.com/alansh

## License

MIT © 2016 Friedel Ziegelmayer
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>)

## 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.
39 changes: 23 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@
],
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"import": "./dist/src/index.js"
},
"./decode": {
"types": "./dist/src/decode.d.ts",
"import": "./dist/src/decode.js"
},
"./encode": {
"types": "./dist/src/encode.d.ts",
"import": "./dist/src/encode.js"
}
},
Expand Down Expand Up @@ -130,7 +133,11 @@
},
{
"type": "docs",
"section": "Trivial Changes"
"section": "Documentation"
},
{
"type": "deps",
"section": "Dependencies"
},
{
"type": "test",
Expand All @@ -147,38 +154,38 @@
]
},
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check dist/src/**/*.js dist/test/**/*.js",
"build": "tsc",
"pretest": "npm run build",
"test": "aegir test -f ./dist/test",
"test:chrome": "npm run test -- -t browser --cov",
"test:chrome-webworker": "npm run test -- -t webworker",
"test:firefox": "npm run test -- -t browser -- --browser firefox",
"test:firefox-webworker": "npm run test -- -t webworker -- --browser firefox",
"test:node": "npm run test -- -t node --cov",
"test:electron-main": "npm run test -- -t electron-main",
"release": "semantic-release"
"dep-check": "aegir dep-check",
"build": "aegir build",
"test": "aegir test",
"test:chrome": "aegir test -t browser --cov",
"test:chrome-webworker": "aegir test -t webworker",
"test:firefox": "aegir test -t browser -- --browser firefox",
"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"
},
"dependencies": {
"err-code": "^3.0.1",
"it-stream-types": "^1.0.4",
"uint8arraylist": "^1.2.0",
"uint8arrays": "^3.0.0",
"varint": "^6.0.0"
},
"devDependencies": {
"@types/varint": "^6.0.0",
"aegir": "^36.1.3",
"aegir": "^37.4.5",
"iso-random-stream": "^2.0.0",
"it-all": "^1.0.6",
"it-block": "^5.0.0",
"it-foreach": "^0.1.1",
"it-map": "^1.0.6",
"it-pipe": "^2.0.2",
"it-pushable": "^2.0.1",
"it-pushable": "^3.0.0",
"it-reader": "^5.0.0",
"p-defer": "^4.0.0",
"random-int": "^3.0.0",
"uint8arrays": "^3.0.0"
"random-int": "^3.0.0"
}
}
2 changes: 1 addition & 1 deletion test/decode.from-reader.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import { pipe } from 'it-pipe'
import { reader } from 'it-reader'
import randomBytes from 'iso-random-stream/src/random.js'
Expand Down
2 changes: 1 addition & 1 deletion test/decode.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import { pipe } from 'it-pipe'
import randomInt from 'random-int'
import randomBytes from 'iso-random-stream/src/random.js'
Expand Down
4 changes: 2 additions & 2 deletions test/e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import varint from 'varint'
import { pipe } from 'it-pipe'
import { block } from 'it-block'
Expand Down Expand Up @@ -89,7 +89,7 @@ describe('e2e', () => {
})

it('push time based', async () => {
const p = pushable<Uint8Array>()
const p = pushable()
const input: Uint8Array[] = []
let i = 0

Expand Down
2 changes: 1 addition & 1 deletion test/encode.single.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import varint from 'varint'
import { someBytes } from './helpers/index.js'
import * as lp from '../src/index.js'
Expand Down
2 changes: 1 addition & 1 deletion test/encode.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from 'aegir/utils/chai.js'
import { expect } from 'aegir/chai'
import { pipe } from 'it-pipe'
import randomInt from 'random-int'
import all from 'it-all'
Expand Down

0 comments on commit a67205e

Please sign in to comment.