# elf-cam

> elf-cam is a WebAssembly(WASM) module to extract very specific information from binary files built for Linux, also known as ELF files.

Latest version **0.1.1** (published 2020-10-21) · Apache 2 license · 0 weekly downloads

## Install

```sh
npm install elf-cam
pnpm add elf-cam
yarn add elf-cam
bun add elf-cam
```

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-10-21 |
| First published | 2020-10-20 |
| Weekly downloads | 0 |
| License | Apache 2 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 92.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | calavera |

## Links

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

## Recent versions

- 0.1.1 (latest) — 2020-10-21
- 0.1.0 — 2020-10-20

## README

## Introduction

elf-cam is a WebAssembly(WASM) module to extract very specific information from binary files built for Linux, also known as ELF files.

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

## Usage

```js
import { readFile } = require("fs");
import * as elf from "elf-cam";

const buffer = await readFile(path);
try {
  const runtime = elf.detect(buffer);
  switch (runtime) {
    case elf.Runtime.Go: console.log("Go binary file"); break;
    case elf.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
```

### 🎁 Publish to NPM with `wasm-pack publish`

```
wasm-pack publish
```

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