Skip to main content

@7c/minilzo@0.1.13

latest

minilzo ffi bindings for deno

This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
64%
Published
2 months ago (0.1.13)

minilzo for deno ffi

Usage

see the demo file

Building

since minilzo is a C library, we need to build it for each architecture. Most of end-consumers do not want to build it, thats why this library has pre-built binaries for Linux, MacOS (arm64). I suggest you to compile it on your own anyways, not to trust pre-built binaries generally.

Linux arm64, armv7l, x86_64

this will build the minilzo library for each architecture and copy it to the bin/ folder. You will need docker installed.

docker build -t minilzo-builder .
docker run --rm -v $(pwd)/bin:/output minilzo-builder

MacOS(arm64, x86_64), Windows(x86_64)

Native Makefile detects the architecture and available compiler and builds the library. Makefile supports gcc and clang compilers. Make sure you have the necessary compilers installed.

make

Precompiled binaries

you can download precompiled binaries from ./bin folder. Create a new folder and wget/curl the binaries into the folder. and use libName() function to get the correct library name. Use with caution. I am putting them here for myself as cheatsheet, you should be compiling them yourself.

test -e ./bin || mkdir ./bin
## MacOS Arm64
wget https://github.com/7c/minilzo/raw/refs/heads/main/bin/minilzo-arm64.dylib -O ./bin/minilzo-arm64.dylib
## MacOS x86_64
...coming soon....
## Linux Arm64
wget https://github.com/7c/minilzo/raw/refs/heads/main/bin/minilzo-arm64.so -O ./bin/minilzo-arm64.so
## Linux Armv7l
wget https://github.com/7c/minilzo/raw/refs/heads/main/bin/minilzo-armv7l.so -O ./bin/minilzo-armv7l.so
## Linux x86_64
wget https://github.com/7c/minilzo/raw/refs/heads/main/bin/minilzo-x86_64.so -O ./bin/minilzo-x86_64.so
## Windows x86_64
...coming soon....
## Windows Arm64
...coming soon....

Install

JSR

import { Minilzo, libName } from "jsr:@7c/minilzo"
 ============================================================================
 miniLZO -- mini subset of the LZO real-time data compression library
 ============================================================================

 Author  : Markus Franz Xaver Johannes Oberhumer
           <markus@oberhumer.com>
           http://www.oberhumer.com/opensource/lzo/
 Version : 2.10
 Date    : 01 Mar 2017

 
 LZO and miniLZO are Copyright (C) 1996-2017 Markus Franz Xaver Oberhumer
 All Rights Reserved.

 LZO and miniLZO are distributed under the terms of the GNU General
 Public License (GPL).  See the file COPYING.

 Special licenses for commercial and other applications which
 are not willing to accept the GNU General Public License
 are available by contacting the author.

Add Package

deno add jsr:@7c/minilzo

Import symbol

import * as minilzo from "@7c/minilzo";

---- OR ----

Import directly with a jsr specifier

import * as minilzo from "jsr:@7c/minilzo";

Add Package

bunx jsr add @7c/minilzo

Import symbol

import * as minilzo from "@7c/minilzo";