File tree Expand file tree Collapse file tree 3 files changed +16
-20
lines changed Expand file tree Collapse file tree 3 files changed +16
-20
lines changed Original file line number Diff line number Diff line change 17
17
with :
18
18
token : ${{ steps.get-token.outputs.token }}
19
19
release-type : node
20
- package-name : " @netlify/@netlify/zip-it-and-ship-it "
20
+ package-name : " @netlify/binary-info "
21
21
- uses : actions/checkout@v3
22
22
if : ${{ steps.release.outputs.release_created }}
23
23
- run :
28
28
node-version : " *"
29
29
registry-url : " https://registry.npmjs.org"
30
30
if : ${{ steps.release.outputs.release_created }}
31
- - run : wasm-pack build --target nodejs --release
31
+ - run : wasm-pack build --target nodejs --release --scope=netlify
32
32
if : ${{ steps.release.outputs.release_created }}
33
- - run : wasm-pack publish
33
+ - run : wasm-pack publish --access public
34
34
if : ${{ steps.release.outputs.release_created }}
35
35
env :
36
36
NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
Original file line number Diff line number Diff line change 1
1
[package ]
2
- name = " elf-cam "
2
+ name = " binary-info "
3
3
version = " 0.1.1"
4
4
authors = [
" David Calavera <[email protected] >" ]
5
5
edition = " 2018"
6
- repository = " https://github.com/netlify/elf-cam "
6
+ repository = " https://github.com/netlify/binary-info "
7
7
license = " Apache 2"
8
- description = " elf-cam is a WebAssembly(WASM) module to extract very specific information from binary files built for Linux, also known as ELF files."
8
+ description = " binary-info is a WebAssembly(WASM) module to extract very specific information from binary files."
9
9
10
10
[lib ]
11
11
crate-type = [" cdylib" , " rlib" ]
Original file line number Diff line number Diff line change 1
1
## Introduction
2
2
3
- elf-cam is a WebAssembly(WASM) module to extract very specific information from binary files built for Linux, also known as ELF files.
3
+ @netlify/binary-info is a WebAssembly(WASM) module to extract very specific
4
+ information from binary files.
4
5
5
- It's used by other Netlify projects to detect Go and Rust binaries built for Netlify Functions.
6
+ It's used by other Netlify projects to detect Go and Rust binaries built for
7
+ Netlify Functions and its architecture and platform .
6
8
7
9
## Usage
8
10
9
11
``` js
10
12
import { readFile } = require(" fs" );
11
- import * as elf from " elf-cam " ;
13
+ import { detect , Runtime } from " @netlify/binary-info " ;
12
14
13
15
const buffer = await readFile (path);
14
16
try {
15
- const runtime = elf .detect (buffer);
16
- switch (runtime) {
17
- case elf . Runtime .Go : console .log (" Go binary file" ); break ;
18
- case elf . Runtime .Rust : console .log (" Rust binary file" ); break ;
17
+ const info = elf .detect (buffer);
18
+ switch (info . runtime ) {
19
+ case Runtime .Go : console .log (" Go binary file" ); break ;
20
+ case Runtime .Rust : console .log (" Rust binary file" ); break ;
19
21
default : console .log (" Unknown binary file" );
20
22
}
21
23
} catch (error) {
28
30
### 🛠️ Build with ` wasm-pack build `
29
31
30
32
```
31
- wasm-pack build --target nodejs --release
32
- ```
33
-
34
- ### 🎁 Publish to NPM with ` wasm-pack publish `
35
-
36
- ```
37
- wasm-pack publish
33
+ wasm-pack build --target nodejs --release --scope=netlify
38
34
```
You can’t perform that action at this time.
0 commit comments