# teensy-loader

> teensy-loader.js ================

Latest version **0.3.1** (published 2022-07-26) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install teensy-loader
pnpm add teensy-loader
yarn add teensy-loader
bun add teensy-loader
```

## 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.3.1 |
| Published | 2022-07-26 |
| First published | 2019-01-13 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 45.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gergely Nagy |
| Maintainers | algernon |

## Links

- npm: https://www.npmjs.com/package/teensy-loader
- Homepage: https://github.com/keyboardio/teensy-loader.js
- npm.io page: https://npm.io/package/teensy-loader

## Dependencies (2)

- [usb](https://npm.io/package/usb.md) ^2.4.2
- [intel-hex](https://npm.io/package/intel-hex.md) ^0.1.1

## Recent versions

- 0.3.1 (latest) — 2022-07-26
- 0.3.0 — 2022-07-24
- 0.2.0 — 2022-03-24
- 0.1.1 — 2019-01-17
- 0.1.0 — 2019-01-13

## README

teensy-loader.js
================

This is a JavaScript library to upload firmware to Teensy-powered devices,
without calling out to any external tools. It currently only supports
`atmega32u4`-based teensies.

## Usage

```javascript
import TeensyLoader from "teensy-loader";

const device = TeensyLoader.open(0x16c0, 0x0478);

TeensyLoader.upload(device , "./firmware.hex", (addr, size) => {
  process.stdout.write(".");
});

TeensyLoader.reboot(device);
```

## API

### `TeensyLoader.open(vendorId, productId)`

Waits for the device with `vendorId` and `productId` to appear, and opens it.
Returns the opened device.

### `TeensyLoader.upload(device, firmwareFile[, progress])`

Uploads the firmware from `firmwareFile` (an Intel Hex format file) to the
previously opened `device`. If the optional `progress` callback is present, it
will be called for every block written, with two arguments: the current address
being written, and the size of the firmware.

Returns `device`.

### `TeensyLoader.reboot(device)`

Reboots an opened device.

### `TeensyLoader.close(device)`

Closes an opened device, without rebooting it.

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