# @netlify/binary-info

> binary-info is a WebAssembly(WASM) module to extract very specific information from binary files.

Latest version **1.0.0** (published 2022-06-23) · Apache 2 license · 0 weekly downloads

## Install

```sh
npm install @netlify/binary-info
pnpm add @netlify/binary-info
yarn add @netlify/binary-info
bun add @netlify/binary-info
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-06-23 |
| First published | 2022-06-23 |
| Weekly downloads | 0 |
| License | Apache 2 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 227.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | orinokai, ericap, seanroberts, dustincrogers, skn0tt, mikewen, dengeist, biilmann, marcus.netlify, jgantunes, eduardoboucas, netlify-bot, nasiba, zachleat, ascorbic |

## Links

- npm: https://www.npmjs.com/package/@netlify/binary-info
- Repository: https://github.com/netlify/binary-info
- Homepage: https://github.com/netlify/binary-info#readme
- Issues: https://github.com/netlify/binary-info/issues
- npm.io page: https://npm.io/package/@netlify/binary-info

## Recent versions

- 1.0.0 (latest) — 2022-06-23
- 0.1.1 — 2022-06-23

## README

## Introduction

@netlify/binary-info is a WebAssembly(WASM) module to extract very specific
information from binary files.

It's used by other Netlify projects to detect Go and Rust binaries built for
Netlify Functions and its architecture and platform .

## Usage

```js
import { readFile } = require("fs");
import { detect, Runtime }from "@netlify/binary-info";

const buffer = await readFile(path);
try {
  const info = elf.detect(buffer);
  switch (info.runtime) {
    case Runtime.Go: console.log("Go binary file"); break;
    case Runtime.Rust: console.log("Rust binary file"); break;
    default: console.log("Unknown binary file");
  }
} catch (error) {
  console.log(error);
}
```

## Development

### 🛠️ Build with `wasm-pack build`

```
wasm-pack build --target nodejs --release --scope=netlify
```

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