Skip to content

Commit

Permalink
feat: Rename package to binary-info and fix release (#15)
Browse files Browse the repository at this point in the history
Release-As: 1.0.0
  • Loading branch information
danez authored Jun 23, 2022
1 parent 4291ef0 commit 0d59e30
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
token: ${{ steps.get-token.outputs.token }}
release-type: node
package-name: "@netlify/@netlify/zip-it-and-ship-it"
package-name: "@netlify/binary-info"
- uses: actions/checkout@v3
if: ${{ steps.release.outputs.release_created }}
- run:
Expand All @@ -28,9 +28,9 @@ jobs:
node-version: "*"
registry-url: "https://registry.npmjs.org"
if: ${{ steps.release.outputs.release_created }}
- run: wasm-pack build --target nodejs --release
- run: wasm-pack build --target nodejs --release --scope=netlify
if: ${{ steps.release.outputs.release_created }}
- run: wasm-pack publish
- run: wasm-pack publish --access public
if: ${{ steps.release.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "elf-cam"
name = "binary-info"
version = "0.1.1"
authors = ["David Calavera <david.calavera@gmail.com>"]
edition = "2018"
repository = "https://github.com/netlify/elf-cam"
repository = "https://github.com/netlify/binary-info"
license = "Apache 2"
description = "elf-cam is a WebAssembly(WASM) module to extract very specific information from binary files built for Linux, also known as ELF files."
description = "binary-info is a WebAssembly(WASM) module to extract very specific information from binary files."

[lib]
crate-type = ["cdylib", "rlib"]
Expand Down
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
## Introduction

elf-cam is a WebAssembly(WASM) module to extract very specific information from binary files built for Linux, also known as ELF files.
@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.
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 * as elf from "elf-cam";
import { detect, Runtime }from "@netlify/binary-info";

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;
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) {
Expand All @@ -28,11 +30,5 @@ try {
### 🛠️ Build with `wasm-pack build`

```
wasm-pack build --target nodejs --release
```

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

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

0 comments on commit 0d59e30

Please sign in to comment.