# sharedstreets-pbf

> SharedStreets, a 'digital commons' for the street

Latest version **0.8.0** (published 2018-03-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install sharedstreets-pbf
pnpm add sharedstreets-pbf
yarn add sharedstreets-pbf
bun add sharedstreets-pbf
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.0 |
| Published | 2018-03-21 |
| First published | 2018-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 321.7 KB |
| Known vulnerabilities | 0 (+11 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | SharedStreets |
| Maintainers | deniscarriere |
| Keywords | sharedstreets, streets, shared, pbf, proto |

## Links

- npm: https://www.npmjs.com/package/sharedstreets-pbf
- Repository: https://github.com/sharedstreets/sharedstreets-pbf
- Homepage: https://github.com/sharedstreets/sharedstreets-pbf#readme
- Issues: https://github.com/sharedstreets/sharedstreets-pbf/issues
- npm.io page: https://npm.io/package/sharedstreets-pbf

## Dependencies (2)

- [protobufjs](https://npm.io/package/protobufjs.md) 6.x
- [sharedstreets-types](https://npm.io/package/sharedstreets-types.md) 1.x

## Recent versions

- 0.8.0 (latest) — 2018-03-21
- 0.7.2 — 2018-02-09
- 0.7.1 — 2018-02-09
- 0.7.0 — 2018-02-09
- 0.6.1 — 2018-02-09
- 0.6.0 — 2018-01-31
- 0.5.0 — 2018-01-29
- 0.4.0 — 2018-01-28
- 0.3.1 — 2018-01-17
- 0.3.0 — 2018-01-17
- 0.2.1 — 2018-01-16
- 0.2.0 — 2018-01-16

## README

# SharedStreets PBF Parser

[![npm version](https://badge.fury.io/js/sharedstreets-pbf.svg)](https://badge.fury.io/js/sharedstreets-pbf)
[![Build Status](https://travis-ci.org/sharedstreets/sharedstreets-pbf.svg?branch=master)](https://travis-ci.org/sharedstreets/sharedstreets-pbf)

Reads [SharedStreets Protobuf buffers](https://github.com/sharedstreets/sharedstreets-ref-system/tree/master/proto).

## Install

**In Node.js**

```bash
$ yarn add sharedstreets-pbf
```

**CommonJS**

```js
const sharedstreetsPbf = require('sharedstreets-pbf');
```

**Typescript**

```js
import * as sharedstreetsPbf from 'sharedstreets-pbf';
```

## In Browser

For a full list of web examples, check out [SharedStreets examples](https://github.com/sharedstreets/sharedstreets-examples).

## How to build

> `sharedstreets-pbf` uses submodules, make sure to include `--recursive` when cloning the repo.

```bash
$ git clone --recursive git@github.com:sharedstreets/sharedstreets-pbf.git
$ cd sharedstreets-pbf
$ yarn
$ yarn build
$ yarn test
```

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

-   [geometry](#geometry)
-   [intersection](#intersection)
-   [reference](#reference)
-   [metadata](#metadata)
-   [readBuffer](#readbuffer)

### geometry

Geometry Pbf

Parser for SharedStreets Geometry Pbf Buffers

**Parameters**

-   `buffer` **[Buffer](https://nodejs.org/api/buffer.html)** Pbf Buffer

**Examples**

```javascript
const buffer = fs.readFileSync('z-x-y.geometry.pbf')

const geoms = sharedstreetsPbf.geometry(buffer)
geoms[0].id // => '81f666c5e1e4de0f7df4fbd793d909b2'
```

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;SharedStreetsGeometry>** An Array of SharedStreet Geometry

### intersection

Intersection Pbf

Parser for SharedStreets Intersection Pbf Buffers

**Parameters**

-   `buffer` **[Buffer](https://nodejs.org/api/buffer.html)** Pbf Buffer

**Examples**

```javascript
const buffer = fs.readFileSync('z-x-y.intersection.pbf')

const intersections = sharedstreetsPbf.intersection(buffer)
intersections[0].id // => '8037a9444353cd7dd3f58d9a436f2537'
```

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;SharedStreetsIntersection>** An Array of SharedStreet Intersections

### reference

Reference Pbf

Parser for SharedStreets Reference Pbf Buffers

**Parameters**

-   `buffer` **[Buffer](https://nodejs.org/api/buffer.html)** Pbf Buffer

**Examples**

```javascript
const buffer = fs.readFileSync('z-x-y.reference.pbf')

const references = sharedstreetsPbf.reference(buffer)
references[0].id // => '41d73e28819470745fa1f93dc46d82a9'
```

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;SharedStreetsReferencePbf>** An Array of SharedStreet References

### metadata

Metadata Pbf

Parser for SharedStreets Metadata Pbf Buffers

**Parameters**

-   `buffer` **[Buffer](https://nodejs.org/api/buffer.html)** Pbf Buffer

**Examples**

```javascript
const buffer = fs.readFileSync('z-x-y.metadata.pbf')

const metadatas = sharedstreetsPbf.metadata(buffer)
metadatas[0].geometryID // => '81f666c5e1e4de0f7df4fbd793d909b2'
```

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;SharedStreetsMetadata>** An Array of SharedStreet Metadatas

### readBuffer

Decode Delimited buffers using protobufjs

**Parameters**

-   `buffer` **([Buffer](https://nodejs.org/api/buffer.html) \| [Uint8Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array))** Pbf Buffer
-   `parser` **any** Protobufjs Parser

**Examples**

```javascript
const parser = sharedstreetsPbf.SharedStreetsProto.GISMetadata;
const results = sharedstreetsPbf.readBuffer(buffer, parser);
```

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>** An Array of based on given Protobufjs Parser

---
_Source: https://npm.io/package/sharedstreets-pbf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
