# can-message

> utility functions for handling CAN data from comma.ai panda

Latest version **0.1.0** (published 2018-03-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install can-message
pnpm add can-message
yarn add can-message
bun add can-message
```

## 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.1.0 |
| Published | 2018-03-18 |
| First published | 2018-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andy Haden, Sean Pollock |
| Maintainers | commabot |
| Keywords | CAN, panda, comma.ai, javascript |

## Links

- npm: https://www.npmjs.com/package/can-message
- npm.io page: https://npm.io/package/can-message

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2018-03-18

## README

# can-message
Pack and unpack CAN bus data.

This library is designed for use with the [Panda OBD-II Dongle](https://shop.comma.ai/products/panda-obd-ii-dongle) as part of [pandajs](https://github.com/commaai/pandajs).

## Installation
`npm i --save can-message`

or

`yarn add can-message`

## Usage
```js
import { canToObject, objectToCan } from 'can-message';

// parse raw buffer into can data
var messageArray = canToObject(buffer);
// messageArray is an array of { address, busTime, data, bus }

// create a buffer containing a can message
var buffer = objectToCan(myCanMessage);
```

```js
const CanMessage = require('can-message');

// parse raw buffer into can data
var messageArray = CanMessage.canToObject(buffer);
// messageArray is an array of { address, busTime, data, bus }

// create a buffer containing a can message
var buffer = CanMessage.objectToCan(myCanMessage);
```

## Contributing
`yarn run test`

# License
MIT @ comma.ai

Read more about how to get started hacking your car with Panda [here](https://medium.com/@comma_ai/a-panda-and-a-cabana-how-to-get-started-car-hacking-with-comma-ai-b5e46fae8646).

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